| 1 | package Net::WebSocket::X::BadArg; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | ▶ | use parent qw( Net::WebSocket::X::Base ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 11 | ▶ | sub _new { | ||||||||
|
Subroutine
_new: called CC=3 SCAR=15.0
| |||||||||||
| 9 | 11 | my ($class, $name, $val, $why) = @_; | |||||||||
| 10 | |||||||||||
| 11 | 11 | my $caller = (caller 1)[3]; | |||||||||
| 12 | |||||||||||
| 13 | 11 | ▶ | if ($why) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 11 | return $class->SUPER::_new( | |||||||||
| 15 | "$caller: invalid “$name” ($val) - $why", | ||||||||||
| 16 | name => $name, | ||||||||||
| 17 | value => $val, | ||||||||||
| 18 | why => $why, | ||||||||||
| 19 | ); | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | my $disp_val = $val; | |||||||||
| 23 | 0 | ▶ | $disp_val = q<> if !defined $val; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | return $class->SUPER::_new( | |||||||||
| 26 | sprintf("%s: invalid “%s” (%s)", $caller, $name, $disp_val), | ||||||||||
| 27 | name => $name, | ||||||||||
| 28 | value => $val, | ||||||||||
| 29 | ); | ||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 3 | 1; | |||||||||