Skip to content

Commit f3903e6

Browse files
authored
In exceptions.rakudoc, remove a CATCH keyword. Plus some stylistic improvements. (#4712)
* remove `CATCH` keyword where all that matters is the block * fix sentence beginning & dash * reword sentence on return value of `try` block * remove empty line * add space
1 parent 34b631d commit f3903e6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

doc/Language/exceptions.rakudoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ the code> in the enclosing block will never be executed.
144144

145145
Compare with this:
146146

147-
CATCH {
147+
{
148148

149149
CATCH {
150150
default { .Str.say; }
@@ -246,7 +246,7 @@ Which would output:
246246
in block <unit> at exception.raku line 21
247247
=end code
248248

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

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

262262
=begin code
@@ -388,10 +388,9 @@ sub bad-sub {
388388
say "Returned $return";
389389
CATCH {
390390
default {
391-
say "Error ", .^name, ': ',.Str;
391+
say "Error ", .^name, ': ', .Str;
392392
$return = '0';
393393
.resume;
394-
395394
}
396395
}
397396
}

0 commit comments

Comments
 (0)