Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
experiment a bit with backtrace printing
inpsired by a discussion with masak++, [Coke]++ and a few others
  • Loading branch information
moritz committed Feb 8, 2012
1 parent 15dc125 commit ef61a32
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/core/Exception.pm
Expand Up @@ -10,7 +10,7 @@ my class Exception {
self.?message.Str // 'Something went wrong'
}
multi method gist(Exception:D:) {
self.?message ~ "\n" ~ $.backtrace;
self.?message ~ "\n" ~ $.backtrace.concise;
}

method throw() is hidden_from_backtrace {
Expand Down Expand Up @@ -80,15 +80,10 @@ do {
my $e := EXCEPTION($ex);
my Mu $err := pir::getstderr__P();

if X::Comp.ACCEPTS($e) {
if X::Comp.ACCEPTS($e) || is_runtime($ex.backtrace) {
$err.print: $e.gist;
$err.print: "\n";
}
elsif is_runtime($ex.backtrace) {
$err.print: $e;
$err.print: "\n";
$err.print: Backtrace.new($e);
}
else {
$err.print: "===SORRY!===\n";
$err.print: $ex;
Expand Down

0 comments on commit ef61a32

Please sign in to comment.