Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions doc/Language/exceptions.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ the code> in the enclosing block will never be executed.

Compare with this:

CATCH {
{

CATCH {
default { .Str.say; }
Expand Down Expand Up @@ -246,7 +246,7 @@ Which would output:
in block <unit> at exception.raku line 21
=end code

Since the C<CATCH> block is handling just the L<C<X::AdHoc>|/type/X::AdHoc> exception
This is because the C<CATCH> block is handling just the L<C<X::AdHoc>|/type/X::AdHoc> exception
thrown by the C<die> statement, but not the C<E> exception. In the
absence of a C<CATCH> block, all exceptions will be contained and
dropped, as indicated above. C<resume> will resume execution right after
Expand All @@ -255,8 +255,8 @@ Please consult the section on
L<resuming of exceptions|/language/exceptions#Resuming_of_exceptions>
for more information on this.

A C<try>-block is a normal block and as such treats its last statement
as the return value of itself. We can therefore use it as a right-hand
A C<try> block is a normal block and as such, uses its last statement
as its return value. We can therefore use it as a right-hand
side.

=begin code
Expand Down Expand Up @@ -388,10 +388,9 @@ sub bad-sub {
say "Returned $return";
CATCH {
default {
say "Error ", .^name, ': ',.Str;
say "Error ", .^name, ': ', .Str;
$return = '0';
.resume;

}
}
}
Expand Down