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   723 use utf8;
  14         58  
  14         83  
4 14     14   590 use 5.016;
  14         48  
5 14     14   83 use strict;
  14         57  
  14         305  
6 14     14   104 use warnings;
  14         78  
  14         502  
7 14     14   85 use Carp qw/longmess/;
  14         33  
  14         1607  
8              
9             $Geoffrey::Exception::Database::VERSION = '0.000205';
10              
11             use Exception::Class 1.23 (
12 14         201 '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   143 );
  14         237  
22              
23             sub throw_no_dbh {
24 5     5 1 52 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 12 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 875 my ( $s_throw_message, $s_sql ) = @_;
35 5         63 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 4 my ( $id, $value, $resp ) = @_;
41 1         19 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__