Skip to content

Commit

Permalink
extract payload from parrot excetions, if available
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Aug 3, 2011
1 parent 8ea619d commit 69e9988
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/Exception.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ my class Exception {
}

sub EXCEPTION(|$) {
my $ex := nqp::create(Exception);
nqp::bindattr($ex, Exception, '$!ex',
nqp::shift(pir::perl6_current_args_rpa__P()));
my Mu $parrot_ex := nqp::shift(pir::perl6_current_args_rpa__P());
my Mu $payload := nqp::atkey($parrot_ex, 'payload');
my $ex := pir::defined($payload) ?? $payload !! nqp::create(Exception);
nqp::bindattr($ex, Exception, '$!ex', $parrot_ex);
$ex;
}

0 comments on commit 69e9988

Please sign in to comment.