File Coverage

blib/lib/Geoffrey/Exception/Database.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 4 4 100.0
total 37 37 100.0


line stmt bran cond sub pod time code
1             package Geoffrey::Exception::Database;
2              
3 14     14   812 use utf8;
  14         29  
  14         85  
4 14     14   560 use 5.016;
  14         49  
5 14     14   66 use strict;
  14         46  
  14         311  
6 14     14   86 use warnings;
  14         80  
  14         490  
7 14     14   85 use Carp qw/longmess/;
  14         34  
  14         1655  
8              
9             $Geoffrey::Exception::Database::VERSION = '0.000203';
10              
11             use Exception::Class 1.23 (
12 14         147 'Geoffrey::Exception::Database' => { description => 'Unidentified exception', },
13             'Geoffrey::Exception::Database::NoDbh' =>
14             { description => 'No default value set for column in table!', },
15             'Geoffrey::Exception::Database::NotDbh' =>
16             { description => 'Given dbh is in a non valid type!', },
17             'Geoffrey::Exception::Database::SqlHandle' =>
18             { description => 'No default value set for column in table!', },
19             'Geoffrey::Exception::Database::CorruptChangeset' =>
20             { description => 'No default value set for column in table!', },
21 14     14   140 );
  14         274  
22              
23             sub throw_no_dbh {
24 5     5 1 53 return Geoffrey::Exception::Database::NoDbh->throw(
25             "No default dbh value is set\n" . longmess );
26             }
27              
28             sub throw_not_dbh {
29 1     1 1 13 return Geoffrey::Exception::Database::NotDbh->throw(
30             "Given dbh is in a non valid type\n" . longmess );
31             }
32              
33             sub throw_sql_handle {
34 5     5 1 2184 my ( $s_throw_message, $s_sql ) = @_;
35 5         85 return Geoffrey::Exception::Database::SqlHandle->throw(
36             "Can't handle sql: $s_sql $s_throw_message\n" . longmess );
37             }
38              
39             sub throw_changeset_corrupt {
40 1     1 1 3 my ( $id, $value, $resp ) = @_;
41 1         46 return Geoffrey::Exception::Database::CorruptChangeset->throw(
42             "MD5 hash changed for changeset: $id expect $value got $resp\n" . longmess );
43             }
44              
45             1;
46              
47             __END__