Skip to content

Commit

Permalink
Mention way to suppress backtrace
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jan 22, 2016
1 parent 568651e commit d0dae21
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Language/exceptions.pod
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,22 @@ method C<.resume> on the exception object.
say "We have continued with control flow."; # this is step 3
=head2 Uncaught Exceptions
If an exception is thrown and not caught, it causes the program to exit with a
non-zero status code, and typically prints a message to the standard error
stream of the program. This message is obtained by calling the C<gist> method
on the exception object. You can use this to suppress the default behavior of
printing a backtrace along with the message:
class X::WithoutLineNumber is X::AdHoc {
multi method gist(X::WithoutLineNumber:D:) {
$.payload
}
}
die X::WithoutLineNumber.new(payload => "message")
# prints "message\n" to $*ERR and exits, no backtrace
=end pod

# vim: expandtab shiftwidth=4 ft=perl6

0 comments on commit d0dae21

Please sign in to comment.