Permalink
Browse files

make World.rethrow more robust, harmil++

  • Loading branch information...
1 parent 3e00089 commit 94283154d1a9f02ad95f0d92c5c275f6e6c82146 @moritz moritz committed Jul 7, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/Perl6/World.pm
View
8 src/Perl6/World.pm
@@ -1970,8 +1970,12 @@ class Perl6::World is HLL::World {
}
method rethrow($/, $err) {
- my $ex_t := self.find_symbol(['X', 'Comp', 'AdHoc']);
- my $coercer := self.find_symbol(['&COMP_EXCEPTION']);
+ my $success := 0;
+ my $ex_t;
+ my $coercer;
+ try { $ex_t := self.find_symbol(['X', 'Comp', 'AdHoc']); $success := 1 };
+ try { $coercer := self.find_symbol(['&COMP_EXCEPTION']); ++$success; };
+ $err.rethrow unless $success == 2;
my $p6ex := $coercer($err);
nqp::bindattr($p6ex, $ex_t, '$!filename',
nqp::box_s(pir::find_caller_lex__ps('$?FILES'),

0 comments on commit 9428315

Please sign in to comment.