line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::LCDproc::Error; |
2
|
|
|
|
|
|
|
$Net::LCDproc::Error::VERSION = '0.1.3'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Error class |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
14
|
use v5.10.2; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
44
|
|
6
|
1
|
|
|
1
|
|
4
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
2233
|
use Data::Dumper qw//; |
|
1
|
|
|
|
|
36999
|
|
|
1
|
|
|
|
|
30
|
|
8
|
1
|
|
|
1
|
|
739
|
use namespace::sweep; |
|
1
|
|
|
|
|
336499
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Throwable::Error'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has class_name => ( |
13
|
|
|
|
|
|
|
is => 'rw', |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#isa => 'Str', |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
default => sub { caller 11 }, # XXX: this seems fragile |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has object => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#isa => 'Object', |
25
|
|
|
|
|
|
|
predicate => 'has_object', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub short_msg { |
29
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
return sprintf '[%s] %s', $self->class_name, $self->message; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub dump_obj { |
34
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
if ($self->has_object) { |
37
|
0
|
|
|
|
|
|
$Data::Dumper::Terse = 1; |
38
|
0
|
|
|
|
|
|
return Data::Dumper->Dump([$self->object]); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return 'No object was set by the throwing class'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub throwf { |
45
|
0
|
|
|
0
|
0
|
|
my ($self, $msg_str, @args) = @_; |
46
|
0
|
|
|
|
|
|
$self->throw(message => sprintf $msg_str, @args); |
47
|
0
|
|
|
|
|
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |