Skip to content

Commit 908f18c

Browse files
committed
explain control exceptions
1 parent ee4169c commit 908f18c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Language/exceptions.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ printing a backtrace along with the message:
187187
die X::WithoutLineNumber.new(payload => "message")
188188
# prints "message\n" to $*ERR and exits, no backtrace
189189
190+
=head1 Control Exceptions
191+
192+
Control exceptions are thrown by certain L<keywords|/language/phasers#CONTROL>
193+
and are handled either automatically or by the appropriate
194+
L<phaser|/language/phasers#Loop_Phasers>. Any unhandled control exception is
195+
converted to a normal exception.
196+
197+
{ return; CATCH { default { say .^name, ': ',.Str } } }
198+
# OUTPUT«X::ControlFlow::Return: Attempt to return outside of any Routine␤»
199+
# was CX::Return
200+
190201
=end pod
191202

192203
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)