line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Error; |
2
|
|
|
|
|
|
|
|
3
|
177
|
|
|
177
|
|
108610
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
398
|
|
|
177
|
|
|
|
|
8354
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
177
|
|
|
177
|
|
97685
|
use Moo; |
|
177
|
|
|
|
|
1882540
|
|
|
177
|
|
|
|
|
960
|
|
8
|
177
|
|
|
177
|
|
346170
|
use namespace::clean; |
|
177
|
|
|
|
|
1708287
|
|
|
177
|
|
|
|
|
1247
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Throwable::Error'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Logger'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has message => ( |
15
|
|
|
|
|
|
|
is => 'lazy', |
16
|
|
|
|
|
|
|
coerce => sub { |
17
|
|
|
|
|
|
|
my $msg = $_[0] // ""; |
18
|
|
|
|
|
|
|
$msg =~ s/\s+$//; |
19
|
|
|
|
|
|
|
$msg; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub BUILD { |
24
|
64
|
|
|
64
|
0
|
193493
|
my ($self) = @_; |
25
|
64
|
|
|
|
|
358
|
my $msg = $self->log_message; |
26
|
62
|
100
|
|
|
|
1447
|
if ($self->log->is_debug) { |
27
|
8
|
|
|
|
|
3864
|
$msg .= "\n\n" . $self->stack_trace->as_string; |
28
|
|
|
|
|
|
|
} |
29
|
62
|
|
|
|
|
45244
|
$self->log->error($msg); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub log_message { |
33
|
30
|
|
|
30
|
0
|
595
|
$_[0]->message; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _build_message { |
37
|
2
|
|
|
2
|
|
44
|
""; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package Catmandu::Error::Source; |
41
|
|
|
|
|
|
|
|
42
|
177
|
|
|
177
|
|
87302
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
520
|
|
|
177
|
|
|
|
|
6907
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
45
|
|
|
|
|
|
|
|
46
|
177
|
|
|
177
|
|
86634
|
use Moo::Role; |
|
177
|
|
|
|
|
1474027
|
|
|
177
|
|
|
|
|
1251
|
|
47
|
177
|
|
|
177
|
|
161599
|
use Catmandu::Util qw(is_string); |
|
177
|
|
|
|
|
798
|
|
|
177
|
|
|
|
|
19499
|
|
48
|
177
|
|
|
177
|
|
1472
|
use namespace::clean; |
|
177
|
|
|
|
|
415
|
|
|
177
|
|
|
|
|
1872
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
has source => (is => 'rw', writer => 'set_source'); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _source_log_message { |
53
|
24
|
|
|
24
|
|
53
|
my $msg = ""; |
54
|
24
|
100
|
|
|
|
266
|
if (is_string(my $source = $_[0]->source)) { |
55
|
15
|
|
|
|
|
39
|
$msg .= "\nSource:"; |
56
|
15
|
|
|
|
|
92
|
for (split(/\n/, $source)) { |
57
|
15
|
|
|
|
|
53
|
$msg .= "\n\t$_"; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
22
|
|
|
|
|
58
|
$msg; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
package Catmandu::BadVal; |
64
|
|
|
|
|
|
|
|
65
|
177
|
|
|
177
|
|
91223
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
465
|
|
|
177
|
|
|
|
|
7456
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
68
|
|
|
|
|
|
|
|
69
|
177
|
|
|
177
|
|
1268
|
use Moo; |
|
177
|
|
|
|
|
444
|
|
|
177
|
|
|
|
|
1774
|
|
70
|
177
|
|
|
177
|
|
77018
|
use namespace::clean; |
|
177
|
|
|
|
|
525
|
|
|
177
|
|
|
|
|
1000
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
extends 'Catmandu::Error'; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
package Catmandu::BadArg; |
75
|
|
|
|
|
|
|
|
76
|
177
|
|
|
177
|
|
51445
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
552
|
|
|
177
|
|
|
|
|
7103
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
79
|
|
|
|
|
|
|
|
80
|
177
|
|
|
177
|
|
1186
|
use Moo; |
|
177
|
|
|
|
|
496
|
|
|
177
|
|
|
|
|
898
|
|
81
|
177
|
|
|
177
|
|
59921
|
use namespace::clean; |
|
177
|
|
|
|
|
486
|
|
|
177
|
|
|
|
|
975
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
extends 'Catmandu::BadVal'; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
package Catmandu::NotImplemented; |
86
|
|
|
|
|
|
|
|
87
|
177
|
|
|
177
|
|
48107
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
531
|
|
|
177
|
|
|
|
|
6991
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
90
|
|
|
|
|
|
|
|
91
|
177
|
|
|
177
|
|
1437
|
use Moo; |
|
177
|
|
|
|
|
523
|
|
|
177
|
|
|
|
|
984
|
|
92
|
177
|
|
|
177
|
|
60534
|
use namespace::clean; |
|
177
|
|
|
|
|
517
|
|
|
177
|
|
|
|
|
994
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
extends 'Catmandu::Error'; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
package Catmandu::NoSuchPackage; |
97
|
|
|
|
|
|
|
|
98
|
177
|
|
|
177
|
|
48550
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
462
|
|
|
177
|
|
|
|
|
9568
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
101
|
|
|
|
|
|
|
|
102
|
177
|
|
|
177
|
|
1204
|
use Moo; |
|
177
|
|
|
|
|
418
|
|
|
177
|
|
|
|
|
990
|
|
103
|
177
|
|
|
177
|
|
62250
|
use namespace::clean; |
|
177
|
|
|
|
|
564
|
|
|
177
|
|
|
|
|
982
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
extends 'Catmandu::Error'; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
has package_name => (is => 'ro'); |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub log_message { |
110
|
12
|
|
|
12
|
0
|
33
|
my ($self) = @_; |
111
|
12
|
|
|
|
|
246
|
my $err = $self->message; |
112
|
12
|
|
|
|
|
140
|
my $pkg_name = $self->package_name; |
113
|
12
|
|
|
|
|
32
|
my $msg = "Failed to load $pkg_name"; |
114
|
12
|
100
|
|
|
|
109
|
if (my ($type, $name) |
|
|
50
|
|
|
|
|
|
115
|
|
|
|
|
|
|
= $pkg_name =~ /^Catmandu::(Importer|Exporter|Store)::(\S+)/) |
116
|
|
|
|
|
|
|
{ |
117
|
5
|
|
|
|
|
31
|
$msg |
118
|
|
|
|
|
|
|
= "Can't find the " |
119
|
|
|
|
|
|
|
. lc($type) |
120
|
|
|
|
|
|
|
. " '$name' in your configuration file or $pkg_name is not installed."; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
elsif ($pkg_name =~ /^Catmandu::Fix::\S+/) { |
123
|
7
|
|
|
|
|
49
|
my ($fix_name) = $pkg_name =~ /([^:]+)$/; |
124
|
7
|
50
|
|
|
|
27
|
if ($fix_name =~ /^[a-z]/) { |
125
|
7
|
|
|
|
|
33
|
$msg |
126
|
|
|
|
|
|
|
= "Tried to execute the fix '$fix_name' but can't find $pkg_name on your system."; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
} |
129
|
12
|
|
|
|
|
61
|
$msg .= "\nError: $err"; |
130
|
12
|
|
|
|
|
33
|
$msg .= "\nPackage name: $pkg_name"; |
131
|
12
|
|
|
|
|
117
|
$msg; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
package Catmandu::FixParseError; |
135
|
|
|
|
|
|
|
|
136
|
177
|
|
|
177
|
|
101828
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
492
|
|
|
177
|
|
|
|
|
7225
|
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
139
|
|
|
|
|
|
|
|
140
|
177
|
|
|
177
|
|
1121
|
use Moo; |
|
177
|
|
|
|
|
450
|
|
|
177
|
|
|
|
|
915
|
|
141
|
177
|
|
|
177
|
|
60154
|
use namespace::clean; |
|
177
|
|
|
|
|
585
|
|
|
177
|
|
|
|
|
989
|
|
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
extends 'Catmandu::Error'; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
with 'Catmandu::Error::Source'; |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub log_message { |
148
|
17
|
|
|
17
|
0
|
48
|
my ($self) = @_; |
149
|
17
|
|
|
|
|
313
|
my $err = $self->message; |
150
|
17
|
|
|
|
|
170
|
my $msg = "Syntax error in your fixes..."; |
151
|
17
|
|
|
|
|
70
|
$msg .= "\nError: $err"; |
152
|
17
|
|
|
|
|
74
|
$msg .= $self->_source_log_message; |
153
|
15
|
|
|
|
|
86
|
$msg; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
package Catmandu::NoSuchFixPackage; |
157
|
|
|
|
|
|
|
|
158
|
177
|
|
|
177
|
|
61816
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
451
|
|
|
177
|
|
|
|
|
6871
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
161
|
|
|
|
|
|
|
|
162
|
177
|
|
|
177
|
|
1122
|
use Moo; |
|
177
|
|
|
|
|
483
|
|
|
177
|
|
|
|
|
960
|
|
163
|
177
|
|
|
177
|
|
61741
|
use namespace::clean; |
|
177
|
|
|
|
|
549
|
|
|
177
|
|
|
|
|
908
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
extends 'Catmandu::NoSuchPackage'; |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
with 'Catmandu::Error::Source'; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
has fix_name => (is => 'ro'); |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
around log_message => sub { |
172
|
|
|
|
|
|
|
my ($orig, $self) = @_; |
173
|
|
|
|
|
|
|
my $fix_name = $self->fix_name; |
174
|
|
|
|
|
|
|
my $msg = $orig->($self); |
175
|
|
|
|
|
|
|
$msg .= "\nFix name: $fix_name" if $fix_name; |
176
|
|
|
|
|
|
|
$msg .= $self->_source_log_message; |
177
|
|
|
|
|
|
|
$msg; |
178
|
|
|
|
|
|
|
}; |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
package Catmandu::BadFixArg; |
181
|
|
|
|
|
|
|
|
182
|
177
|
|
|
177
|
|
65861
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
499
|
|
|
177
|
|
|
|
|
6532
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
185
|
|
|
|
|
|
|
|
186
|
177
|
|
|
177
|
|
1191
|
use Moo; |
|
177
|
|
|
|
|
518
|
|
|
177
|
|
|
|
|
2147
|
|
187
|
177
|
|
|
177
|
|
60606
|
use namespace::clean; |
|
177
|
|
|
|
|
552
|
|
|
177
|
|
|
|
|
984
|
|
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
extends 'Catmandu::BadArg'; |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
with 'Catmandu::Error::Source'; |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
has package_name => (is => 'ro'); |
194
|
|
|
|
|
|
|
has fix_name => (is => 'ro'); |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
sub log_message { |
197
|
3
|
|
|
3
|
0
|
9
|
my ($self) = @_; |
198
|
3
|
|
|
|
|
70
|
my $err = $self->message; |
199
|
3
|
|
|
|
|
40
|
my $fix_name = $self->fix_name; |
200
|
3
|
|
|
|
|
12
|
my $msg |
201
|
|
|
|
|
|
|
= "The fix '$fix_name' was called with missing or wrong arguments."; |
202
|
3
|
|
|
|
|
22
|
$msg .= "\nError: $err"; |
203
|
3
|
|
|
|
|
14
|
$msg .= $self->_source_log_message; |
204
|
3
|
|
|
|
|
70
|
$msg; |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
package Catmandu::FixError; |
208
|
|
|
|
|
|
|
|
209
|
177
|
|
|
177
|
|
72899
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
506
|
|
|
177
|
|
|
|
|
6746
|
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
212
|
|
|
|
|
|
|
|
213
|
177
|
|
|
177
|
|
5276
|
use Moo; |
|
177
|
|
|
|
|
513
|
|
|
177
|
|
|
|
|
834
|
|
214
|
177
|
|
|
177
|
|
176213
|
use Data::Dumper; |
|
177
|
|
|
|
|
1196230
|
|
|
177
|
|
|
|
|
14249
|
|
215
|
177
|
|
|
177
|
|
1526
|
use namespace::clean; |
|
177
|
|
|
|
|
391
|
|
|
177
|
|
|
|
|
1176
|
|
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
extends 'Catmandu::Error'; |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
has data => (is => 'ro'); |
220
|
|
|
|
|
|
|
has fix => (is => 'ro'); |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
sub log_message { |
223
|
3
|
|
|
3
|
0
|
9
|
my ($self) = @_; |
224
|
3
|
|
|
|
|
63
|
my $err = $self->message; |
225
|
3
|
|
|
|
|
36
|
my $fix = $self->fix; |
226
|
3
|
|
|
|
|
13
|
my $data = $self->data; |
227
|
3
|
|
|
|
|
19
|
my $msg = "One of your fixes threw an error..."; |
228
|
3
|
|
|
|
|
14
|
$msg .= "\nError: $err"; |
229
|
3
|
50
|
|
|
|
11
|
$msg .= "\nSource: $fix" if $fix; |
230
|
3
|
100
|
|
|
|
17
|
$msg .= "\nInput:\n" . Dumper($data) if defined $data; |
231
|
3
|
|
|
|
|
125
|
$msg; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
package Catmandu::HTTPError; |
235
|
|
|
|
|
|
|
|
236
|
177
|
|
|
177
|
|
73795
|
use Catmandu::Sane; |
|
177
|
|
|
|
|
466
|
|
|
177
|
|
|
|
|
5544
|
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
239
|
|
|
|
|
|
|
|
240
|
177
|
|
|
177
|
|
1056
|
use Moo; |
|
177
|
|
|
|
|
413
|
|
|
177
|
|
|
|
|
1078
|
|
241
|
177
|
|
|
177
|
|
61257
|
use Data::Dumper; |
|
177
|
|
|
|
|
555
|
|
|
177
|
|
|
|
|
8862
|
|
242
|
177
|
|
|
177
|
|
1238
|
use namespace::clean; |
|
177
|
|
|
|
|
482
|
|
|
177
|
|
|
|
|
1040
|
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
# avoid circular dependencies |
245
|
|
|
|
|
|
|
require Catmandu::Util; |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
extends 'Catmandu::Error'; |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
has code => (is => 'ro'); |
250
|
|
|
|
|
|
|
has url => (is => 'ro'); |
251
|
|
|
|
|
|
|
has method => (is => 'ro'); |
252
|
|
|
|
|
|
|
has request_headers => (is => 'ro'); |
253
|
|
|
|
|
|
|
has request_body => (is => 'ro'); |
254
|
|
|
|
|
|
|
has response_headers => (is => 'ro'); |
255
|
|
|
|
|
|
|
has response_body => (is => 'ro'); |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
sub log_message { |
258
|
6
|
|
|
6
|
0
|
18
|
my ($self) = @_; |
259
|
6
|
|
|
|
|
133
|
my $err = $self->message; |
260
|
6
|
|
|
|
|
88
|
my $code = $self->code; |
261
|
6
|
|
|
|
|
25
|
my $url = $self->url; |
262
|
6
|
|
|
|
|
22
|
my $method = $self->method; |
263
|
6
|
|
|
|
|
21
|
my $request_body = $self->request_body; |
264
|
6
|
|
|
|
|
21
|
my $response_body = $self->response_body; |
265
|
6
|
|
|
|
|
30
|
my $request_headers = $self->request_headers; |
266
|
6
|
|
|
|
|
19
|
my $response_headers = $self->response_headers; |
267
|
6
|
|
|
|
|
11
|
my $msg = "Got a HTTP error..."; |
268
|
6
|
|
|
|
|
25
|
$msg .= "\nError: $err"; |
269
|
6
|
|
|
|
|
21
|
$msg .= "\nCode: $code"; |
270
|
6
|
|
|
|
|
18
|
$msg .= "\nURL: $url"; |
271
|
6
|
|
|
|
|
20
|
$msg .= "\nMethod: $method"; |
272
|
6
|
|
|
|
|
24
|
$msg .= "\nRequest headers: " |
273
|
|
|
|
|
|
|
. $self->_headers_to_string($request_headers); |
274
|
|
|
|
|
|
|
|
275
|
6
|
100
|
|
|
|
41
|
if (Catmandu::Util::is_string($request_body)) { |
276
|
1
|
|
|
|
|
15
|
$msg .= "\nRequest body: \n" . $self->_indent($request_body); |
277
|
|
|
|
|
|
|
} |
278
|
6
|
|
|
|
|
19
|
$msg .= "\nResponse headers: " |
279
|
|
|
|
|
|
|
. $self->_headers_to_string($response_headers); |
280
|
6
|
100
|
|
|
|
34
|
if (Catmandu::Util::is_string($response_body)) { |
281
|
5
|
|
|
|
|
21
|
$msg .= "\nResponse body: \n" . $self->_indent($response_body); |
282
|
|
|
|
|
|
|
} |
283
|
6
|
|
|
|
|
70
|
$msg; |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub _headers_to_string { |
287
|
12
|
|
|
12
|
|
30
|
my ($self, $headers) = @_; |
288
|
12
|
|
|
|
|
23
|
my $str = ""; |
289
|
12
|
|
|
|
|
2047
|
for (my $i = 0; $i < @$headers; $i++) { |
290
|
29
|
|
|
|
|
100
|
$str .= "\n\t" . $headers->[$i++] . ": " . $headers->[$i]; |
291
|
|
|
|
|
|
|
} |
292
|
12
|
|
|
|
|
61
|
$str; |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
sub _indent { |
296
|
6
|
|
|
6
|
|
23
|
my ($self, $str) = @_; |
297
|
6
|
|
|
|
|
139
|
$str =~ s/([^\r\n]+)/\t$1/g; |
298
|
6
|
|
|
|
|
39
|
$str; |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
1; |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
__END__ |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=pod |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=head1 NAME |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
Catmandu::Error - Catmandu error hierarchy |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=head1 SYNOPSIS |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
use Catmandu::Sane; |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
sub be_naughty { |
316
|
|
|
|
|
|
|
Catmandu::BadArg->throw("very naughty") if shift; |
317
|
|
|
|
|
|
|
} |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
try { |
320
|
|
|
|
|
|
|
be_naughty(1); |
321
|
|
|
|
|
|
|
} catch_case [ |
322
|
|
|
|
|
|
|
'Catmandu::BadArg' => sub { |
323
|
|
|
|
|
|
|
say "sorry"; |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
]; |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=head1 CURRRENT ERROR HIERARCHY |
328
|
|
|
|
|
|
|
Throwable::Error |
329
|
|
|
|
|
|
|
Catmandu::Error |
330
|
|
|
|
|
|
|
Catmandu::BadVal |
331
|
|
|
|
|
|
|
Catmandu::BadArg |
332
|
|
|
|
|
|
|
Catmandu::BadFixArg |
333
|
|
|
|
|
|
|
Catmandu::NotImplemented |
334
|
|
|
|
|
|
|
Catmandu::NoSuchPackage |
335
|
|
|
|
|
|
|
Catmandu::NoSuchFixPackage |
336
|
|
|
|
|
|
|
Catmandu::FixParseError |
337
|
|
|
|
|
|
|
Catmandu::FixError |
338
|
|
|
|
|
|
|
Catmandu::HTTPError |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=head1 SEE ALSO |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
L<Throwable> |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
=cut |