Stomper/Error.pm

filter: Statementstmt 100% 29 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 36 / 36 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Stomper/Frame.pm ↑ Summary
1 package AnyEvent::Stomper::Error;
2  
3 5 ▶use 5.008000;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 our $VERSION = '0.36';
8  
9 5 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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
21 2 my $class = shift;
22 2 my $err_msg = shift;
23 2 my $err_code = shift;
24 2 my $err_frame = shift;
25  
26 2 my $self = bless {}, $class;
27  
28 2 $self->{message} = $err_msg;
29 2 $self->{code} = $err_code;
30 2 $self->{frame} = $err_frame;
31  
32 2 return $self;
33 }
34  
35 # Generate getters
36 {
37 5 ▶ no strict qw( refs );
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 5 foreach my $name ( qw( message code frame ) )
40 {
41 15 ▶ *{$name} = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
42 1 my $self = shift;
43 1 return $self->{$name};
44 }
45 15 }
46 }
47  
48 5 1;
49 __END__
« Stomper/Frame.pm ↑ Summary