line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AnyEvent::Stomper::Error; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
75
|
use 5.008000; |
|
4
|
|
|
|
|
9
|
|
4
|
4
|
|
|
4
|
|
15
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
66
|
|
5
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
422
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.33_01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our %ERROR_CODES = ( |
10
|
|
|
|
|
|
|
E_CANT_CONN => 1, |
11
|
|
|
|
|
|
|
E_IO => 2, |
12
|
|
|
|
|
|
|
E_CONN_CLOSED_BY_REMOTE_HOST => 3, |
13
|
|
|
|
|
|
|
E_CONN_CLOSED_BY_CLIENT => 4, |
14
|
|
|
|
|
|
|
E_OPRN_ERROR => 5, |
15
|
|
|
|
|
|
|
E_UNEXPECTED_DATA => 6, |
16
|
|
|
|
|
|
|
E_READ_TIMEDOUT => 7, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
2
|
|
|
2
|
1
|
1509
|
my $class = shift; |
22
|
2
|
|
|
|
|
4
|
my $err_msg = shift; |
23
|
2
|
|
|
|
|
4
|
my $err_code = shift; |
24
|
2
|
|
|
|
|
2
|
my $err_frame = shift; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
4
|
my $self = bless {}, $class; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
10
|
$self->{message} = $err_msg; |
29
|
2
|
|
|
|
|
4
|
$self->{code} = $err_code; |
30
|
2
|
|
|
|
|
4
|
$self->{frame} = $err_frame; |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
5
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Generate getters |
36
|
|
|
|
|
|
|
{ |
37
|
4
|
|
|
4
|
|
16
|
no strict qw( refs ); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
273
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
foreach my $name ( qw( message code frame ) ) |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
*{$name} = sub { |
42
|
1
|
|
|
1
|
|
1
|
my $self = shift; |
43
|
1
|
|
|
|
|
16
|
return $self->{$name}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
__END__ |