From 1fb3cfa7e6c6abfca99573265d772a925f382bcc Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Wed, 25 Dec 2002 16:20:03 +0000 Subject: [PATCH] If the exception isn't handled, it should be re-raised. --- webtools/PLIF/PLIF/Exception.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webtools/PLIF/PLIF/Exception.pm b/webtools/PLIF/PLIF/Exception.pm index e757a860ef09..f36b09e57049 100644 --- a/webtools/PLIF/PLIF/Exception.pm +++ b/webtools/PLIF/PLIF/Exception.pm @@ -218,6 +218,7 @@ sub create { sub handle { my $self = shift; my($exception) = @_; + my $reraise = undef; handler: while (1) { if (defined($exception)) { foreach my $handler (@{$self->{'handlers'}}) { @@ -228,11 +229,15 @@ sub handle { not $result->isa('PLIF::Exception::Internal::Unhandled')) { last handler; } + # else, it's the result of an "unhandled" function call $result->{'resolved'} = 1; } } if (defined($self->{'except'})) { &{$self->{'except'}}($exception); + } else { + # unhandled exception + $reraise = $exception; } } last; @@ -241,7 +246,9 @@ sub handle { &{$self->{'finally'}}(); } $self->{'resolved'} = 1; - return defined($exception); + if (defined($reraise)) { + $reraise->raise(); + } } sub DESTROY {