Skip to content

Commit 9326575

Browse files
committed
doc Failure.new
1 parent 1a74aea commit 9326575

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/Type/Failure.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ failure to throw.
2424
2525
=head1 Methods
2626
27+
=head mothod new
28+
29+
Defined as:
30+
method new(Failure:D: $payload --> Failure)
31+
32+
Returns a new C<Failure> instance with the given payload. The latter can be
33+
either an C<Exception> or a payload for an C<Exception>. A typical payload
34+
would be a C<Str> with an error message. A list of payloads is also excepted.
35+
36+
my $e = Failure.new(now.DateTime, 'WELP‼');
37+
say $e;
38+
CATCH{ default { say .^name, ': ', .Str } }
39+
# OUTPUT: «X::AdHoc: 2017-09-10T11:56:05.477237ZWELP‼␤»
40+
2741
=head2 method handled
2842
2943
Defined as:

0 commit comments

Comments
 (0)