Skip to content

Commit

Permalink
Adds nice to Backtrace refs #2809
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Jun 9, 2019
1 parent d17da25 commit 278a180
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion doc/Type/Backtrace.pod6
Expand Up @@ -24,6 +24,13 @@ if ($!) {
This will print the last dataframe in the list, pointing at the line where it's
happened.
=for code
sub zipi { { { die "Something bad happened" }() }() };
try zipi;
say $!.backtrace.nice( :oneline ) if $! │
# OUTPUT: « in sub zipi at /tmp/Ik2MevkgP1 line 1␤␤»
=head1 Methods
=head2 method new
Expand All @@ -48,7 +55,7 @@ be used instead of the current code.
Defined as:
multi method gist(Backtrace:D: --> Str:D)
multi method gist(Backtrace:D:)
Returns string C<"Backtrace(42 frames)"> where the number indicates the number
of frames available via L<list|/routine/list> method.
Expand All @@ -66,6 +73,15 @@ the implementation, also some routines from the setting.
my $backtrace = Backtrace.new;
say $backtrace.Str;
=head2 method nice
Defined as:
method nice(Backtrace:D: :$oneline)
Returns the backtrace as a list of I<interesting> frames. If C<:$oneline> is
set, will stop after the first frame.
=head2 method full
Defined as:
Expand Down

0 comments on commit 278a180

Please sign in to comment.