line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: ErrorHandler.pm,v 1.1.1.1 2004/08/15 14:55:43 btrott Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Class::ErrorHandler; |
4
|
2
|
|
|
2
|
|
3558
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
51
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
7
|
use vars qw( $VERSION $ERROR ); |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
183
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.04'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub error { |
10
|
4
|
|
50
|
4
|
1
|
301
|
my $msg = $_[1] || ''; |
11
|
4
|
100
|
|
|
|
8
|
if (ref($_[0])) { |
12
|
2
|
|
|
|
|
4
|
$_[0]->{_errstr} = $msg; |
13
|
|
|
|
|
|
|
} else { |
14
|
2
|
|
|
|
|
2
|
$ERROR = $msg; |
15
|
|
|
|
|
|
|
} |
16
|
4
|
|
|
|
|
4
|
return; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub errstr { |
20
|
4
|
100
|
|
4
|
1
|
477
|
ref($_[0]) ? $_[0]->{_errstr} : $ERROR |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
__END__ |