IProto/Error.pm

filter: Statementstmt 78.5% 11 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 75.0% 15 / 20 CC 1 SCAR 4.1
CC
1
Cov
79%
is_error
2.0
error_message
2.0
BEGIN
1.0
CRAP 1.5
« IProto/Request.pm ↑ Summary IProto/Message.pm »
1 package MR::IProto::Error;
2  
3 =head1 NAME
4  
5 MR::IProto::Error - iproto error
6  
7 =head1 DESCRIPTION
8  
9 Instance of this class is returned instead of L<MR::IProto::Response>
10 if error was occured.
11  
12 =cut
13  
14 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 =head1 PUBLIC ATTRIBUTES
17  
18 =over
19  
20 =item error
21  
22 Error string.
23  
24 =cut
25  
26 1 has error => (
27 is => 'ro',
28 isa => 'Str',
29 required => 1,
30 );
31  
32 =item errno
33  
34 Integer value of C<$!>.
35  
36 =cut
37  
38 1 has errno => (
39 is => 'ro',
40 isa => 'Int',
41 );
42  
43 =item request
44  
45 Instance of L<MR::IProto::Request>.
46  
47 =cut
48  
49 1 has request => (
50 is => 'ro',
51 isa => 'MR::IProto::Request',
52 required => 1,
53 );
54  
55 =back
56  
57 =head1 PUBLIC METHODS
58  
59 =over
60  
61 =item is_error
62  
63 Always returns true.
64  
65 =cut
66  
67 0 ▶sub is_error {
Subroutine is_error: not called CC=1 SCAR=6.9
Pod documented
68 0 return 1;
69 }
70  
71 =item error_message
72  
73 Error message text.
74  
75 =cut
76  
77 0 ▶sub error_message {
Subroutine error_message: not called CC=1 SCAR=6.9
Pod documented
78 0 my ($self) = @_;
79 0 return $self->error;
80 }
81  
82 =back
83  
84 =cut
85  
86 1 ▶no Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
87 1 __PACKAGE__->meta->make_immutable();
88  
89 1 1;
« IProto/Request.pm ↑ Summary IProto/Message.pm »