Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make error reporting more robust
  • Loading branch information
moritz committed Feb 13, 2012
1 parent 5b9e9af commit 306626c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/Backtrace.pm
Expand Up @@ -72,9 +72,10 @@ my class Backtrace is List {
Int;
}

method outer-caller-idx(Int $startidx) {
method outer-caller-idx(Int $startidx is copy) {
my %print;
my $start = $.at_pos($startidx).code;
return $startidx.list unless $start;
my $current = $start.outer;
my %outers;
while $current {
Expand Down
4 changes: 3 additions & 1 deletion src/core/Exception.pm
Expand Up @@ -10,7 +10,9 @@ my class Exception {
self.?message.Str // 'Something went wrong'
}
multi method gist(Exception:D:) {
self.?message ~ "\n" ~ $.backtrace
my $str = try self.?message ~ "\n" ~ $.backtrace;
$! ?? "Error while creating error string: $!.message() $!.backtrace.full()"
!! $str;
}

method throw() is hidden_from_backtrace {
Expand Down

0 comments on commit 306626c

Please sign in to comment.