| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Protocol::Database::PostgreSQL::Error; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
36
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.000'; # VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Protocol::Database::PostgreSQL::Error - represents a PostgreSQL error |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This inherits from L to provide a wrapper for exceptions and notices |
|
15
|
|
|
|
|
|
|
raised by the server. |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
|
18
|
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
4
|
use parent qw(Ryu::Exception); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
4
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 code |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
The failing code. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
|
28
|
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub code { shift->{code} } |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 file |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Which PostgreSQL source file the error was raised from. |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
sub file { shift->{file} } |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 line |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The line number in the PostgreSQL source file which raised this error. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
|
sub line { shift->{line} } |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 message |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The error message from the server. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
1
|
|
sub message { shift->{message} } |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 position |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
The character offset in the input query. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
|
60
|
|
|
|
|
|
|
|
|
61
|
0
|
|
|
0
|
1
|
|
sub position { shift->{position} } |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 routine |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Which PostgreSQL processing routine raised this. |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
|
68
|
|
|
|
|
|
|
|
|
69
|
0
|
|
|
0
|
1
|
|
sub routine { shift->{routine} } |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 severity |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Relative severity of the error, e.g. NOTICE or FATAL. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
|
76
|
|
|
|
|
|
|
|
|
77
|
0
|
|
|
0
|
1
|
|
sub severity { shift->{severity} } |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 type |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Look up the error information in tables extracted from PostgreSQL official documentation. |
|
82
|
|
|
|
|
|
|
Returns a string corresponding to the error code, or C if it's not in the tables |
|
83
|
|
|
|
|
|
|
(or from a newer version than this module supports, currently 11.2). |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
|
86
|
|
|
|
|
|
|
|
|
87
|
0
|
|
0
|
0
|
1
|
|
sub type { $Protocol::Database::PostgreSQL::ERROR_CODE{shift->{code}} // 'unknown' } |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 AUTHOR |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Tom Molesworth |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 LICENSE |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself. |
|
98
|
|
|
|
|
|
|
|