line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## HTML Object - ~/lib/HTML/Object/Exception.pm |
3
|
|
|
|
|
|
|
## Version v0.2.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2021 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2021/11/27 |
7
|
|
|
|
|
|
|
## Modified 2022/09/18 |
8
|
|
|
|
|
|
|
## All rights reserved |
9
|
|
|
|
|
|
|
## |
10
|
|
|
|
|
|
|
## |
11
|
|
|
|
|
|
|
## This program is free software; you can redistribute it and/or modify it |
12
|
|
|
|
|
|
|
## under the same terms as Perl itself. |
13
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
package HTML::Object::Exception; |
15
|
|
|
|
|
|
|
BEGIN |
16
|
|
|
|
|
|
|
{ |
17
|
29
|
|
|
29
|
|
212
|
use strict; |
|
29
|
|
|
|
|
54
|
|
|
29
|
|
|
|
|
964
|
|
18
|
29
|
|
|
29
|
|
137
|
use warnings; |
|
29
|
|
|
|
|
48
|
|
|
29
|
|
|
|
|
774
|
|
19
|
29
|
|
|
29
|
|
138
|
use parent qw( Module::Generic::Exception ); |
|
29
|
|
|
|
|
42
|
|
|
29
|
|
|
|
|
155
|
|
20
|
29
|
|
|
29
|
|
125242
|
use vars qw( $VERSION ); |
|
29
|
|
|
|
|
63
|
|
|
29
|
|
|
|
|
1232
|
|
21
|
29
|
|
|
29
|
|
513
|
our $VERSION = 'v0.2.0'; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
29
|
|
|
29
|
|
149
|
use strict; |
|
29
|
|
|
|
|
54
|
|
|
29
|
|
|
|
|
532
|
|
25
|
29
|
|
|
29
|
|
128
|
use warnings; |
|
29
|
|
|
|
|
51
|
|
|
29
|
|
|
|
|
6640
|
|
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
sub columnNumber { return( shift->_set_get_number( 'column', @_ ) ); } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub colno { return( shift->columnNumber( @_ ) ); } |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
|
sub fileName { return( shift->file( @_ ) ); } |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
|
sub filename { return( shift->file( @_ ) ); } |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
sub lineNumber { return( shift->line( @_ ) ); } |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
sub lineno { return( shift->line( @_ ) ); } |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
0
|
0
|
1
|
|
sub name { return( ref( $_[0] ) || $_[0] ); } |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub stack { return( shift->trace ); } |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
1
|
|
sub toLocalString { return( shift->as_string ); } |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
|
sub toString { return( shift->as_string ); } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
package |
49
|
|
|
|
|
|
|
HTML::Object::HierarchyRequestError; |
50
|
|
|
|
|
|
|
BEGIN |
51
|
0
|
|
|
|
|
0
|
{ |
52
|
29
|
|
|
29
|
|
199
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
49
|
|
|
29
|
|
|
|
|
139
|
|
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
package HTML::Object::IndexSizeError; |
56
|
|
|
|
|
|
|
BEGIN |
57
|
0
|
|
|
|
|
0
|
{ |
58
|
29
|
|
|
29
|
|
2166
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
55
|
|
|
29
|
|
|
|
|
117
|
|
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
package |
62
|
|
|
|
|
|
|
HTML::Object::InvalidCharacterError; |
63
|
|
|
|
|
|
|
BEGIN |
64
|
0
|
|
|
|
|
0
|
{ |
65
|
29
|
|
|
29
|
|
1828
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
59
|
|
|
29
|
|
|
|
|
121
|
|
66
|
|
|
|
|
|
|
}; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package |
69
|
|
|
|
|
|
|
HTML::Object::InvalidStateError; |
70
|
|
|
|
|
|
|
BEGIN |
71
|
0
|
|
|
|
|
0
|
{ |
72
|
29
|
|
|
29
|
|
1781
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
50
|
|
|
29
|
|
|
|
|
119
|
|
73
|
|
|
|
|
|
|
}; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
package HTML::Object::MediaError; |
76
|
|
|
|
|
|
|
BEGIN |
77
|
0
|
|
|
|
|
0
|
{ |
78
|
29
|
|
|
29
|
|
2580
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
78
|
|
|
29
|
|
|
|
|
135
|
|
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
package HTML::Object::NotFoundError; |
82
|
|
|
|
|
|
|
BEGIN |
83
|
0
|
|
|
|
|
0
|
{ |
84
|
29
|
|
|
29
|
|
1788
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
70
|
|
|
29
|
|
|
|
|
125
|
|
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
package |
88
|
|
|
|
|
|
|
HTML::Object::SyntaxError; |
89
|
|
|
|
|
|
|
BEGIN |
90
|
0
|
|
|
|
|
0
|
{ |
91
|
29
|
|
|
29
|
|
1718
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
53
|
|
|
29
|
|
|
|
|
112
|
|
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
package |
95
|
|
|
|
|
|
|
HTML::Object::TypeError; |
96
|
|
|
|
|
|
|
BEGIN |
97
|
0
|
|
|
|
|
|
{ |
98
|
29
|
|
|
29
|
|
1698
|
use parent -norequire, qw( HTML::Object::Exception ); |
|
29
|
|
|
0
|
|
51
|
|
|
29
|
|
|
|
|
100
|
|
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
# NOTE: POD |
104
|
|
|
|
|
|
|
__END__ |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=encoding utf-8 |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 NAME |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
HTML::Object::Exception - HTML Object |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 SYNOPSIS |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
use HTML::Object::Exception; |
115
|
|
|
|
|
|
|
my $this = HTML::Object::Exception->new || |
116
|
|
|
|
|
|
|
die( HTML::Object::Exception->error, "\n" ); |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 VERSION |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
v0.2.0 |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 DESCRIPTION |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
This class inherits all its features and methods from L<Module::Generic::Exception>, and implements the following additional methods: |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 METHODS |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head2 colno |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
An alias for L</columnNumber> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 columnNumber |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Returns the column number, which usually returns C<undef>, because this is not set. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head2 fileName |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
The file name where the error occurred. This is an alias for L<Module::Generic::Exception/file> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head2 filename |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
An alias for L</fileName> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 lineno |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head2 lineNumber |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
The line number where the error occurred. This is an alias for L<Module::Generic::Exception/line> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 name |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Returns the class name. For example: C<HTML::Object::Exception> |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 stack |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Returns the stack trace object. This is an alias for L<Module::Generic::Exception/trace> |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head2 toLocalString |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This is an alias for L<Module::Generic::Exception/as_string> |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head2 toString |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
This is an alias for L<Module::Generic::Exception/as_string> |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head2 OTHER EXCEPTION CLASSES |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
This module also implements the following exception classes used predominantly by L<HTML::Object::DOM> |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=over 4 |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=item HTML::Object::ErrorEvent |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
The L<HTML::Object::ErrorEvent> object represents an error triggered and captured by a global error in the L<HTML::Object::DOM::Document> object. |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
It is used by properties like L<HTML::Object::DOM::Document/onabort> or L<HTML::Object::DOM::Document/onerror> |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
See L<for more information|https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent> |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item HTML::Object::HierarchyRequestError |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
The C<HTML::Object::HierarchyRequestError> object represents an error when the node tree hierarchy is not correct. |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item HTML::Object::IndexSizeError |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
The C<HTML::Object::IndexSizeError> object representations an error that occurs when an index is not in the allowed range. |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
For example, in L<HTML::Object::DOM::CharacterData/substringData> |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=item HTML::Object::InvalidCharacterError |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
The C<HTML::Object::InvalidCharacterError> object represents an error when a given named parameter contains one or more characters which are not valid. |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=item HTML::Object::InvalidStateError |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
The C<HTML::Object::InvalidStateError> object represents an error when there is in an invalid state. |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=item HTML::Object::MediaError |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
The C<HTML::Object::MediaError> object represents a L<HTML::Object::DOM::Element::Media> error. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=item HTML::Object::NotFoundError |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
The C<HTML::Object::NotFoundError> object represents an error when the object cannot be found here. |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=item HTML::Object::SyntaxError |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
The C<HTML::Object::SyntaxError> object represents an error when trying to interpret syntactically invalid code. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=item HTML::Object::TypeError |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
The C<HTML::Object::TypeError> object represents an error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=back |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head1 AUTHOR |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head1 SEE ALSO |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
L<HTML::Object::HierarchyRequestError>, L<Module::Generic::Exception>, L<Module::Generic/error> |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/DOMException> |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
L<HTML::Object>, L<HTML::Object::Attribute>, L<HTML::Object::Boolean>, L<HTML::Object::Closing>, L<HTML::Object::Collection>, L<HTML::Object::Comment>, L<HTML::Object::Declaration>, L<HTML::Object::Document>, L<HTML::Object::Element>, L<HTML::Object::Exception>, L<HTML::Object::Literal>, L<HTML::Object::Number>, L<HTML::Object::Root>, L<HTML::Object::Space>, L<HTML::Object::Text>, L<HTML::Object::XQuery> |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
Copyright(c) 2021 DEGUEST Pte. Ltd. |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
All rights reserved |
233
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |