line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PocketIO::Exception; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
32
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
189
|
|
4
|
6
|
|
|
6
|
|
29
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
2452
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
35
|
use overload '""' => sub { $_[0]->to_string }, fallback => 1; |
|
6
|
|
|
3
|
|
11
|
|
|
6
|
|
|
|
|
50
|
|
|
3
|
|
|
|
|
98
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Carp; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
3
|
|
|
3
|
0
|
5
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
|
|
14
|
my $self = bless {@_}, $class; |
14
|
|
|
|
|
|
|
|
15
|
3
|
|
50
|
|
|
50
|
$self->{code} ||= 500; |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
87
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
0
|
0
|
sub code { $_[0]->{code} } |
21
|
3
|
|
|
3
|
0
|
14
|
sub message { $_[0]->{message} } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub throw { |
24
|
3
|
|
|
3
|
0
|
5
|
my $class = shift; |
25
|
3
|
|
|
|
|
5
|
my ($code, $message) = @_; |
26
|
|
|
|
|
|
|
|
27
|
3
|
50
|
|
|
|
9
|
$message = '' unless defined $message; |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
11
|
Carp::croak($class->new(code => $code, message => $message)); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
*as_string = \&to_string; |
33
|
3
|
|
|
3
|
0
|
7
|
sub to_string { $_[0]->message } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |