| 1 | package DBIx::ParseException::SQLite; | ||||||||||||||||||||||
| 2 | 1 | ▶ | BEGIN { | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 3 | 1 | $DBIx::ParseException::SQLite::VERSION = '0.001000_03'; | |||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||
| 5 | |||||||||||||||||||||||
| 6 | 1 | ▶ | use DBIx::Exceptions; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 7 | |||||||||||||||||||||||
| 8 | 0 | ▶ | sub capabilities { $_[0] } | ||||||||||||||||||||
|
Subroutine
capabilities: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||
| 9 | |||||||||||||||||||||||
| 10 | 0 | ▶ | sub error_handler { | ||||||||||||||||||||
|
Subroutine
error_handler: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||
| 11 | 0 | my $string = shift; | |||||||||||||||||||||
| 12 | 0 | my @args = ( original => $string ); | |||||||||||||||||||||
| 13 | 0 | my $class = 'DBIx::Exception'; | |||||||||||||||||||||
| 14 | |||||||||||||||||||||||
| 15 | 0 | ▶ | if (my ($column) = $string =~ /^DBD::SQLite::st \s+ execute \s+ failed: \s+ (?:constraint \s+ failed \s+)? | ||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||
| 16 | column \s+ (.*) \s+ is \s+ not \s+ unique/ixm) { | ||||||||||||||||||||||
| 17 | 0 | $class .= '::NotUnique'; | |||||||||||||||||||||
| 18 | 0 | push @args, ( column => $column ); | |||||||||||||||||||||
| 19 | } elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ near \s+ | ||||||||||||||||||||||
| 20 | "(.*)": \s+ syntax \s+ error/ixm) { | ||||||||||||||||||||||
| 21 | 0 | $class .= '::Syntax'; | |||||||||||||||||||||
| 22 | 0 | push @args, ( near => $1 ); | |||||||||||||||||||||
| 23 | } elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ no \s+ | ||||||||||||||||||||||
| 24 | such \s+ table: \s+ (.*)/ixm) { | ||||||||||||||||||||||
| 25 | 0 | $class .= '::NoSuchTable'; | |||||||||||||||||||||
| 26 | 0 | push @args, ( table => $1 ); | |||||||||||||||||||||
| 27 | } elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ table \s+ | ||||||||||||||||||||||
| 28 | (.*) \s+ has \s+ no \s+ column \s+ named \s+ (.*)/ixm) { | ||||||||||||||||||||||
| 29 | 0 | $class .= '::NoSuchColumn'; | |||||||||||||||||||||
| 30 | 0 | push @args, ( table => $1, column => $2 ); | |||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||
| 32 | |||||||||||||||||||||||
| 33 | 0 | $class->throw(@args); | |||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||
| 35 | |||||||||||||||||||||||
| 36 | 1 | ▶ | use constant { | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 37 | 1 | can_unique_constraint => 1, | |||||||||||||||||||||
| 38 | can_unique_constraint_column => 1, | ||||||||||||||||||||||
| 39 | |||||||||||||||||||||||
| 40 | can_syntax => 1, | ||||||||||||||||||||||
| 41 | can_syntax_near => 1, | ||||||||||||||||||||||
| 42 | |||||||||||||||||||||||
| 43 | can_no_such_table => 1, | ||||||||||||||||||||||
| 44 | can_no_such_table_table => 1, | ||||||||||||||||||||||
| 45 | |||||||||||||||||||||||
| 46 | can_no_such_column => 1, | ||||||||||||||||||||||
| 47 | can_no_such_column_table => 1, | ||||||||||||||||||||||
| 48 | can_no_such_column_column => 1, | ||||||||||||||||||||||
| 49 | 1 | }; | |||||||||||||||||||||
| 50 | |||||||||||||||||||||||
| 51 | 1 | 1; | |||||||||||||||||||||
| 52 | # vim: ts=2 tw=2 expandtab | ||||||||||||||||||||||
| 53 | |||||||||||||||||||||||
| 54 | __END__ | ||||||||||||||||||||||