Skip to content

Instantly share code, notes, and snippets.

@moritz
Created August 10, 2011 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moritz/1138149 to your computer and use it in GitHub Desktop.
Save moritz/1138149 to your computer and use it in GitHub Desktop.
Backtraces, once more
my Mu $comp := pir::compreg__Ps('perl6');
$comp.HOW.add_method($comp, 'handle-exception',
method (|$) {
my Mu $ex := nqp::atpos(
pir::perl6_current_args_rpa__P(),
1
);
say 'custom handler';
say EXCEPTION($ex);
say BackTrace.new(EXCEPTION($ex));
}
);
die 'foo';
custom handler
foo
in sub die at src/gen/CORE.setting:370
in mu <anon> at bt.pl:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment