line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SPOPS::Error; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Error.pm,v 3.3 2004/06/02 00:48:21 lachoy Exp $ |
4
|
|
|
|
|
|
|
|
5
|
23
|
|
|
23
|
|
140
|
use strict; |
|
23
|
|
|
|
|
47
|
|
|
23
|
|
|
|
|
971
|
|
6
|
23
|
|
|
23
|
|
621
|
use vars qw( @FIELDS ); |
|
23
|
|
|
|
|
53
|
|
|
23
|
|
|
|
|
1165
|
|
7
|
23
|
|
|
23
|
|
5372
|
use Data::Dumper qw( Dumper ); |
|
23
|
|
|
|
|
36011
|
|
|
23
|
|
|
|
|
4221
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
*_w = *SPOPS::_w; |
10
|
|
|
|
|
|
|
*DEBUG = *SPOPS::DEBUG; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$SPOPS::Error::VERSION = sprintf("%d.%02d", q$Revision: 3.3 $ =~ /(\d+)\.(\d+)/); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@FIELDS = qw( user_msg system_msg type extra |
15
|
|
|
|
|
|
|
package filename line method ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub clear { |
18
|
5
|
|
|
5
|
0
|
10
|
my ( $class ) = @_; |
19
|
23
|
|
|
23
|
|
153
|
no strict 'refs'; |
|
23
|
|
|
|
|
48
|
|
|
23
|
|
|
|
|
3918
|
|
20
|
5
|
|
|
|
|
13
|
for ( @FIELDS ) { ${ $class . '::' . $_ } = undef } |
|
40
|
|
|
|
|
44
|
|
|
40
|
|
|
|
|
131
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get { |
25
|
6
|
|
|
6
|
0
|
15
|
my ( $class ) = @_; |
26
|
23
|
|
|
23
|
|
133
|
no strict 'refs'; |
|
23
|
|
|
|
|
43
|
|
|
23
|
|
|
|
|
2088
|
|
27
|
6
|
|
|
|
|
14
|
return { map { $_ => ${ $class . '::' . $_ } } @FIELDS }; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
171
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub set { |
32
|
5
|
|
|
5
|
0
|
248
|
my ( $class, $p ) = @_; |
33
|
5
|
|
|
|
|
20
|
$class->clear; |
34
|
|
|
|
|
|
|
{ |
35
|
23
|
|
|
23
|
|
257
|
no strict 'refs'; |
|
23
|
|
|
|
|
53
|
|
|
23
|
|
|
|
|
3356
|
|
|
5
|
|
|
|
|
9
|
|
36
|
5
|
|
|
|
|
10
|
for ( @FIELDS ) { ${ $class . '::' . $_ } = $p->{ $_} } |
|
40
|
|
|
|
|
54
|
|
|
40
|
|
|
|
|
98
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Set the caller information if the user didn't pass anything in |
40
|
|
|
|
|
|
|
|
41
|
5
|
50
|
33
|
|
|
100
|
unless ( $p->{package} and $p->{filename} and $p->{line} ) { |
|
|
|
33
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
( $SPOPS::Error::package, |
43
|
|
|
|
|
|
|
$SPOPS::Error::filename, |
44
|
|
|
|
|
|
|
$SPOPS::Error::line, |
45
|
|
|
|
|
|
|
$SPOPS::Error::method ) = caller(0); |
46
|
|
|
|
|
|
|
} |
47
|
5
|
|
|
|
|
21
|
return $class->get; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |