line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
17
|
|
|
17
|
|
97
|
use strict; |
|
17
|
|
|
|
|
35
|
|
|
17
|
|
|
|
|
955
|
|
2
|
17
|
|
|
17
|
|
97
|
use warnings; |
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
1097
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Config:Scoped::Error - an exception class hierarchy based on Error.pm for Config::Scoped |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Config::Scoped::Error; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Config::Scoped::Error::Parse->throw( |
13
|
|
|
|
|
|
|
-text => $parser_error, |
14
|
|
|
|
|
|
|
-file => $config_file, |
15
|
|
|
|
|
|
|
-line => $thisline, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Config::Scoped::Error::IO->throw( |
19
|
|
|
|
|
|
|
-text => "can't open file: $!", |
20
|
|
|
|
|
|
|
-file => $config_file, |
21
|
|
|
|
|
|
|
-line => $thisline, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Config::Scoped::Error::Validate::Macro->throw( |
25
|
|
|
|
|
|
|
-text => "macro redefinition: $macro_name", |
26
|
|
|
|
|
|
|
-file => $config_file, |
27
|
|
|
|
|
|
|
-line => $thisline, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Config::Scoped::Error is a class hierarchy based on Error.pm. The following Exception class hierarchy is defined: |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Config::Scoped::Error |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Config::Scoped::Error::Parse |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Config::Scoped::Error::Validate |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Config::Scoped::Error::Validate::Macro |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Config::Scoped::Error::Validate::Parameter |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Config::Scoped::Error::Validate::Declaration |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Config::Scoped::Error::Validate::Permissions |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Config::Scoped::Error::IO |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
package Config::Scoped::Error; |
53
|
17
|
|
|
17
|
|
95
|
use base 'Error'; |
|
17
|
|
|
|
|
27
|
|
|
17
|
|
|
|
|
18470
|
|
54
|
|
|
|
|
|
|
our $VERSION='0.22'; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#Error propagation, see perldoc -f die |
57
|
|
|
|
|
|
|
sub PROPAGATE { |
58
|
17
|
|
|
17
|
|
118461
|
no warnings 'uninitialized'; |
|
17
|
|
|
|
|
43
|
|
|
17
|
|
|
|
|
2184
|
|
59
|
0
|
|
|
0
|
0
|
0
|
$_[0]->{-propagate} .= "propagated at $_[1] line $_[2]\n"; |
60
|
0
|
|
|
|
|
0
|
return $_[0]; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# private accessor |
64
|
|
|
|
|
|
|
sub _propagate { |
65
|
20
|
50
|
|
20
|
|
165
|
return exists $_[0]->{-propagate} ? $_[0]->{-propagate} : undef; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Override Error::stringify. |
69
|
|
|
|
|
|
|
# Add the file and line if not ending in a newline and |
70
|
|
|
|
|
|
|
# add the propagated text. |
71
|
|
|
|
|
|
|
sub stringify { |
72
|
17
|
|
|
17
|
|
103
|
no warnings 'uninitialized'; |
|
17
|
|
|
|
|
40
|
|
|
17
|
|
|
|
|
2320
|
|
73
|
20
|
|
|
20
|
1
|
30807
|
my $file = $_[0]->file; |
74
|
20
|
|
|
|
|
213
|
my $line = $_[0]->line; |
75
|
20
|
|
50
|
|
|
188
|
my $propagate = $_[0]->_propagate || ''; |
76
|
|
|
|
|
|
|
|
77
|
20
|
|
|
|
|
148
|
my $text = $_[0]->SUPER::stringify; |
78
|
|
|
|
|
|
|
|
79
|
20
|
100
|
|
|
|
199
|
$text .= " at $file line $line.\n" |
80
|
|
|
|
|
|
|
unless ( $text =~ /\n$/s ); |
81
|
|
|
|
|
|
|
|
82
|
20
|
|
|
|
|
39
|
$text .= $propagate; |
83
|
|
|
|
|
|
|
|
84
|
20
|
|
|
|
|
121
|
return $text; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
package Config::Scoped::Error::Parse; |
88
|
17
|
|
|
17
|
|
103
|
use base 'Config::Scoped::Error'; |
|
17
|
|
|
|
|
37
|
|
|
17
|
|
|
|
|
2006
|
|
89
|
|
|
|
|
|
|
our $VERSION='0.22'; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
package Config::Scoped::Error::IO; |
92
|
17
|
|
|
17
|
|
91
|
use base 'Config::Scoped::Error'; |
|
17
|
|
|
|
|
37
|
|
|
17
|
|
|
|
|
1671
|
|
93
|
|
|
|
|
|
|
our $VERSION='0.22'; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
package Config::Scoped::Error::Validate; |
96
|
17
|
|
|
17
|
|
89
|
use base 'Config::Scoped::Error'; |
|
17
|
|
|
|
|
34
|
|
|
17
|
|
|
|
|
1496
|
|
97
|
|
|
|
|
|
|
our $VERSION='0.22'; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
package Config::Scoped::Error::Validate::Macro; |
100
|
17
|
|
|
17
|
|
226
|
use base 'Config::Scoped::Error::Validate'; |
|
17
|
|
|
|
|
36
|
|
|
17
|
|
|
|
|
16774
|
|
101
|
|
|
|
|
|
|
our $VERSION='0.22'; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
package Config::Scoped::Error::Validate::Parameter; |
104
|
17
|
|
|
17
|
|
118
|
use base 'Config::Scoped::Error::Validate'; |
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
9094
|
|
105
|
|
|
|
|
|
|
our $VERSION='0.22'; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
package Config::Scoped::Error::Validate::Declaration; |
108
|
17
|
|
|
17
|
|
108
|
use base 'Config::Scoped::Error::Validate'; |
|
17
|
|
|
|
|
37
|
|
|
17
|
|
|
|
|
8464
|
|
109
|
|
|
|
|
|
|
our $VERSION='0.22'; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
package Config::Scoped::Error::Validate::Permissions; |
112
|
17
|
|
|
17
|
|
272
|
use base 'Config::Scoped::Error::Validate'; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
9641
|
|
113
|
|
|
|
|
|
|
our $VERSION='0.22'; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
1; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 SEE ALSO |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Config::Scoped, Error |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 AUTHOR |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Karl Gaissmaier Ekarl.gaissmaier at uni-ulm.deE |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Copyright (c) 2004-2008 by Karl Gaissmaier |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
130
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
# vim: cindent sm nohls sw=4 sts=4 ruler |
135
|
|
|
|
|
|
|
|