Skip to content

Instantly share code, notes, and snippets.

@cognominal
Created January 11, 2012 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cognominal/1596551 to your computer and use it in GitHub Desktop.
Save cognominal/1596551 to your computer and use it in GitHub Desktop.
controlling backtrace with env var RAKUDO_BACKTRACE
--- a/src/core/Exception.pm
+++ b/src/core/Exception.pm
@@ -69,10 +69,15 @@ do {
$err.print: $e.gist;
$err.print: "\n";
}
- elsif is_runtime($ex.backtrace) {
+ elsif %*ENV<RAKUDO_BACKTRACE> | is_runtime($ex.backtrace) {
$err.print: $e;
$err.print: "\n";
- $err.print: Backtrace.new($e);
+ my $b := Backtrace.new($e);
+ given %*ENV<RAKUDO_BACKTRACE> {
+ when 'concise' { $err.print: $b.concise }
+ when 'full' { $err.print: $b.full }
+ when * { $err.print: $b.Str }
+ }
}
else {
$err.print: "===SORRY!===\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment