File Coverage

examples/MyErrorHandler.pm
Criterion Covered Total %
statement 2 8 25.0
branch n/a
condition n/a
subroutine 1 4 25.0
pod 0 4 0.0
total 3 16 18.7


line stmt bran cond sub pod time code
1             # An example of simple SAX error handler
2             # XML::Directory throws fatal errors only
3              
4             package MyErrorHandler;
5              
6             sub new {
7 1     1 0 6 my $type = shift;
8 1         4 return bless {}, $type;
9             }
10              
11             sub warning {
12 0     0 0   my ($self, $exception) = @_;
13            
14 0           print "Warning: $exception->{Message}\n";
15             }
16              
17             sub error {
18 0     0 0   my ($self, $exception) = @_;
19            
20 0           print "Error: $exception->{Message}\n";
21             }
22              
23             sub fatal_error {
24 0     0 0   my ($self, $exception) = @_;
25            
26 0           print "Fatal Error: $exception->{Message}\n";
27             }
28              
29             1;