line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SPOPS::Exception::DBI; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: DBI.pm,v 3.3 2004/06/02 00:48:22 lachoy Exp $ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1664
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
48
|
|
6
|
1
|
|
|
1
|
|
7
|
use base qw( SPOPS::Exception ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
337
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$SPOPS::Exception::DBI::VERSION = sprintf("%d.%02d", q$Revision: 3.3 $ =~ /(\d+)\.(\d+)/); |
9
|
|
|
|
|
|
|
@SPOPS::Exception::DBI::EXPORT_OK = qw( spops_dbi_error ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @FIELDS = qw( sql bound_value action ); |
12
|
|
|
|
|
|
|
SPOPS::Exception::DBI->mk_accessors( @FIELDS ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub get_fields { |
15
|
1
|
|
|
1
|
0
|
9
|
return ( $_[0]->SUPER::get_fields, @FIELDS ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub spops_dbi_error { |
19
|
0
|
|
|
0
|
0
|
0
|
goto &SPOPS::Exception::throw( 'SPOPS::Exception::DBI', @_ ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub to_string { |
23
|
1
|
|
|
1
|
0
|
4
|
my ( $self ) = @_; |
24
|
1
|
|
|
|
|
3
|
my $class = ref $self; |
25
|
1
|
50
|
|
|
|
6
|
return "Invalid -- not called from object." unless ( $class ); |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
|
50
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
207
|
|
28
|
1
|
50
|
|
|
|
5
|
if ( $self->sql ) { |
29
|
1
|
50
|
|
|
|
12
|
return ( ${ $class . '::ShowTrace' } ) |
|
1
|
|
|
|
|
92
|
|
30
|
|
|
|
|
|
|
? join( "\n", $self->message, $self->sql, $self->trace->as_string ) |
31
|
|
|
|
|
|
|
: join( "\n", $self->message(), $self->sql ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
0
|
0
|
|
|
|
|
return ( ${ $class . '::ShowTrace' } ) |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
? join( "\n", $self->message, $self->trace->as_string ) |
36
|
|
|
|
|
|
|
: $self->message(); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |