Skip to content

Commit

Permalink
walk up to the first non-setting line when printing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 26, 2010
1 parent d7ebff5 commit 08dc36c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Perl6/BacktracePrinter.pm
Expand Up @@ -16,8 +16,13 @@ method backtrace_for($exception) {
# If it's just a warning, then we want to just append a line and
# file to the error and be done.
if self.is_warning($exception) {
my $location := @backtrace[0]<annotations>;
$trace := $trace ~ self.backtrace_line(@backtrace[0]<sub>, @backtrace[0]<annotations>);
my $i := 0;
while $i < +@backtrace
&& @backtrace[$i]<annotations><file> eq 'CORE.setting' {
$i++;
}

$trace := $trace ~ self.backtrace_line(@backtrace[$i]<sub>, @backtrace[$i]<annotations>);
return $trace;
}

Expand Down

0 comments on commit 08dc36c

Please sign in to comment.