File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,13 @@ It's possible to handle exceptional circumstances by supplying a C<CATCH> block:
52
52
die X::IO::DoesNotExist.new(:path("foo/bar"), :trying("zombie copy"));
53
53
54
54
CATCH {
55
- when X::IO { say "some kind of IO exception was caught!" }
55
+ when X::IO { $*ERR. say: "some kind of IO exception was caught!" }
56
56
}
57
57
58
58
# RESULT: «some kind of IO exception was caught!»
59
59
60
60
Here, we are saying that if any exception of type C < X::IO > occurs, then the
61
- message C < some kind of IO exception was caught! > will be displayed.
61
+ message C < some kind of IO exception was caught! > will be sent to I < stderr > and displayed.
62
62
63
63
A X < C < CATCH > |CATCH> block uses smart matching similar to how C < given/when > smart
64
64
matches on options, thus it's possible to catch and handle various categories of
You can’t perform that action at this time.
0 commit comments