Skip to content

Commit e0ec41e

Browse files
committed
Revises exception page
Closes #2368 after @uzluisf's work. Thanks!
1 parent 2cc97e3 commit e0ec41e

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

doc/Language/exceptions.pod6

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
55
=SUBTITLE Using exceptions in Perl 6
66
7-
Exceptions in Perl 6 are objects that hold information about errors. An error
8-
can be, for example, the unexpected receiving of data or a network connection no
9-
longer available, or a missing file. The information that an exception objects
10-
store is, for instance, a human-readable message about the error condition, the
11-
backtrace of the raising of the error, and so on.
7+
Exceptions in Perl 6 are objects that hold information about errors. An
8+
error can be, for example, the unexpected receiving of data or a network
9+
connection no longer available, or a missing file. The information that
10+
an exception objects store is, for instance, a human-readable message
11+
about the error condition, the backtrace of the raising of the error,
12+
and so on.
1213
1314
All built-in exceptions inherit from L<Exception>, which provides some basic
1415
behavior, including the storage of a backtrace and an interface for the
@@ -123,11 +124,11 @@ how to return control back to where the exception originated.
123124
X<|try blocks>
124125
=head1 C<try> blocks
125126
126-
A C<try> block is a normal block with the
127-
L<C<use fatal> pragma|/language/pragmas#index-entry-fatal-fatal>
128-
turned on and an implicit C<CATCH> block that drops the exception, which
129-
means you can use it to contain them. If the exception is caught, then it's
130-
stored inside the C<$!> variable which holds a value of type C<Exception>.
127+
A C<try> block is a normal block with the L<C<use fatal>
128+
pragma|/language/pragmas#index-entry-fatal-fatal> turned on and an
129+
implicit C<CATCH> block that drops the exception, which means you can
130+
use it to contain them. Caught exceptions are stored inside the C<$!>
131+
variable, which holds a value of type C<Exception>.
131132
132133
=begin code
133134
{
@@ -144,10 +145,10 @@ if $! { say "Something failed!" } # OUTPUT: «Something failed!␤»
144145
say $!.^name; # OUTPUT: «X::Str::Numeric␤»
145146
=end code
146147
147-
Any exception that is thrown in such a block will be caught by the implicit
148-
C<CATCH> block or a C<CATCH> block provided by the user. In the latter case, any
149-
unhandled exception will be rethrown. If you choose not to handle the exception,
150-
they will be contained by the block.
148+
Any exception that is thrown in such a block will be caught by a
149+
C<CATCH> block, either implicit provided by the user. In the latter
150+
case, any unhandled exception will be rethrown. If you choose not to
151+
handle the exception, they will be contained by the block.
151152
152153
=begin code
153154
try {

0 commit comments

Comments
 (0)