line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::ParseError; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
790162
|
use strict; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
118
|
|
4
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
99
|
|
5
|
4
|
|
|
4
|
|
21
|
use Moo; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
83
|
|
6
|
4
|
|
|
4
|
|
1382
|
use Try::Tiny; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
287
|
|
7
|
4
|
|
|
4
|
|
32
|
use Module::Runtime 'use_module'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
31
|
|
8
|
4
|
|
|
4
|
|
217
|
use DBIx::Class::Exception; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
1739
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has _schema => ( |
14
|
|
|
|
|
|
|
is => 'ro', required => 1, init_arg => 'schema', |
15
|
|
|
|
|
|
|
handles => { _storage => 'storage' } |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has db_driver => ( |
19
|
|
|
|
|
|
|
is => 'lazy', init_arg => undef, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
4
|
|
106
|
sub _build_db_driver { shift->_storage->sqlt_type } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has _parser_class => ( |
25
|
|
|
|
|
|
|
is => 'lazy', builder => '_build_parser_class', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _build_parser_class { |
29
|
4
|
|
|
4
|
|
161
|
return join q{::}, 'DBIx::Class::ParseError::Parser', shift->db_driver; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
has _parser => ( |
33
|
|
|
|
|
|
|
is => 'lazy', builder => '_build_parser', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _build_parser { |
37
|
4
|
|
|
4
|
|
51
|
my $self = shift; |
38
|
|
|
|
|
|
|
return try { |
39
|
4
|
|
|
4
|
|
313
|
use_module( $self->_parser_class )->new( |
40
|
|
|
|
|
|
|
schema => $self->_schema, |
41
|
|
|
|
|
|
|
custom_errors => $self->custom_errors, |
42
|
|
|
|
|
|
|
) |
43
|
4
|
|
|
0
|
|
42
|
} catch { die 'No parser found for ' . $self->_db_driver }; |
|
0
|
|
|
|
|
0
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
has custom_errors => ( |
47
|
|
|
|
|
|
|
is => 'ro', |
48
|
|
|
|
|
|
|
default => sub { {} }, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub process { |
52
|
17
|
|
|
17
|
0
|
2347625
|
my ($self, $error) = @_; |
53
|
17
|
|
|
17
|
|
1103
|
return try { $self->_parser->process($error) } |
54
|
17
|
|
|
0
|
|
174
|
catch { warn $_; DBIx::Class::Exception->throw($error) }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |