line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Client Exception Class |
2
|
|
|
|
|
|
|
package API::Client::Exception; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
7
|
use namespace::autoclean -except => 'has'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
87
|
use Data::Object::Class; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
7
|
1
|
|
|
1
|
|
323
|
use Data::Object::Class::Syntax; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
8
|
1
|
|
|
1
|
|
276
|
use Data::Object::Signatures; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
6
|
use Data::Object::Library qw( |
11
|
|
|
|
|
|
|
InstanceOf |
12
|
|
|
|
|
|
|
Int |
13
|
|
|
|
|
|
|
Str |
14
|
1
|
|
|
1
|
|
8382
|
); |
|
1
|
|
|
|
|
2
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
extends 'Data::Object::Exception'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $MESSAGE = "%s response received while processing request %s %s"; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# ATTRIBUTES |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has code => ro; |
25
|
|
|
|
|
|
|
has method => ro; |
26
|
|
|
|
|
|
|
has tx => ro; |
27
|
|
|
|
|
|
|
has url => ro; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# CONSTRAINTS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
req code => Int; |
32
|
|
|
|
|
|
|
req method => Str; |
33
|
|
|
|
|
|
|
req tx => InstanceOf['Mojo::Transaction']; |
34
|
|
|
|
|
|
|
req url => InstanceOf['Mojo::URL']; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# MODIFIERS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
alt message => lazy; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# DEFAULTS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
def message => method { |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sprintf "$MESSAGE\n", map "@{[$self->$_]}", qw(code method url); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |