Created
January 11, 2012 20:16
-
-
Save cognominal/1596551 to your computer and use it in GitHub Desktop.
controlling backtrace with env var RAKUDO_BACKTRACE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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