Skip to content

Commit 98ef33c

Browse files
committed
add fail to Control Flow
1 parent 628efba commit 98ef33c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/Language/control.pod6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,16 @@ All these forms may produce a return value the same way C<loop> does.
700700
701701
Same as C<return>, but returns a writable container.
702702
703+
=head1 X<fail|control flow>
704+
705+
Leaves the current routine and returns the provided
706+
L<Exception|/type/Exception> or C<Str> wrapped inside a
707+
L<Failure|/type/Failure>.
708+
709+
sub f { "WELP!" };
710+
dd f;
711+
# OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "wut?"), backtrace => Backtrace.new)␤»
712+
703713
=head1 X<once|control flow>
704714
705715
A block prefix with C<once> will be executed exactly once, even if placed inside a

0 commit comments

Comments
 (0)