| 1 |
## ------------------------------------------------------------------------ |
| 2 |
## $Id: Object.pm,v 1.3 2003/02/18 18:33:59 joko Exp $ |
| 3 |
## ------------------------------------------------------------------------ |
| 4 |
## $Log: Object.pm,v $ |
| 5 |
## ------------------------------------------------------------------------ |
| 6 |
|
| 7 |
|
| 8 |
package DesignPattern::Exception; |
| 9 |
|
| 10 |
use strict; |
| 11 |
use warnings; |
| 12 |
|
| 13 |
sub checkExceptions { |
| 14 |
my $self = shift; |
| 15 |
|
| 16 |
# behaviour A: die on error |
| 17 |
#die ($@) if $@; |
| 18 |
|
| 19 |
# behaviour B: log the error message as a warning |
| 20 |
if ($@) { |
| 21 |
$self->log($@, 'warning'); |
| 22 |
} |
| 23 |
|
| 24 |
} |
| 25 |
|
| 26 |
1; |
| 27 |
__END__ |