зеркало из https://github.com/mozilla/gecko-dev.git
If the exception isn't handled, it should be re-raised.
This commit is contained in:
Родитель
08576caa95
Коммит
1fb3cfa7e6
|
@ -218,6 +218,7 @@ sub create {
|
||||||
sub handle {
|
sub handle {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my($exception) = @_;
|
my($exception) = @_;
|
||||||
|
my $reraise = undef;
|
||||||
handler: while (1) {
|
handler: while (1) {
|
||||||
if (defined($exception)) {
|
if (defined($exception)) {
|
||||||
foreach my $handler (@{$self->{'handlers'}}) {
|
foreach my $handler (@{$self->{'handlers'}}) {
|
||||||
|
@ -228,11 +229,15 @@ sub handle {
|
||||||
not $result->isa('PLIF::Exception::Internal::Unhandled')) {
|
not $result->isa('PLIF::Exception::Internal::Unhandled')) {
|
||||||
last handler;
|
last handler;
|
||||||
}
|
}
|
||||||
|
# else, it's the result of an "unhandled" function call
|
||||||
$result->{'resolved'} = 1;
|
$result->{'resolved'} = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (defined($self->{'except'})) {
|
if (defined($self->{'except'})) {
|
||||||
&{$self->{'except'}}($exception);
|
&{$self->{'except'}}($exception);
|
||||||
|
} else {
|
||||||
|
# unhandled exception
|
||||||
|
$reraise = $exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last;
|
last;
|
||||||
|
@ -241,7 +246,9 @@ sub handle {
|
||||||
&{$self->{'finally'}}();
|
&{$self->{'finally'}}();
|
||||||
}
|
}
|
||||||
$self->{'resolved'} = 1;
|
$self->{'resolved'} = 1;
|
||||||
return defined($exception);
|
if (defined($reraise)) {
|
||||||
|
$reraise->raise();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub DESTROY {
|
sub DESTROY {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче