@@ -60,6 +60,36 @@ The package allows objects to be instantiated with key-value arguments.
6060
6161=cut
6262
63+ =head1 ATTRIBUTES
64+
65+ This package has the following attributes:
66+
67+ =cut
68+
69+ =head2 context
70+
71+ context(Any)
72+
73+ This attribute is read-only, accepts C<(Any)> values, and is optional.
74+
75+ =cut
76+
77+ =head2 id
78+
79+ id(Str)
80+
81+ This attribute is read-only, accepts C<(Str)> values, and is optional.
82+
83+ =cut
84+
85+ =head2 message
86+
87+ message(Str)
88+
89+ This attribute is read-only, accepts C<(Str)> values, and is optional.
90+
91+ =cut
92+
6393=head1 METHODS
6494
6595This package implements the following methods:
@@ -88,22 +118,46 @@ The explain method returns an error message with stack trace.
88118
89119=head2 throw
90120
91- throw(Str $class , Any $context, Maybe[Number] $offset) : Any
121+ throw(Tuple[ Str, Str] | Str $message , Any $context, Maybe[Number] $offset) : Any
92122
93- The throw method throws an error with message.
123+ The throw method throws an error with message (and optionally, an ID) .
94124
95125=over 4
96126
97127=item throw example #1
98128
99129 use Data::Object::Exception;
100130
131+ my $exception = Data::Object::Exception->new;
132+
133+ $exception->throw('Oops!')
134+
135+ =back
136+
137+ =over 4
138+
139+ =item throw example #2
140+
141+ use Data::Object::Exception;
142+
101143 my $exception = Data::Object::Exception->new('Oops!');
102144
103145 $exception->throw
104146
105147=back
106148
149+ =over 4
150+
151+ =item throw example #3
152+
153+ use Data::Object::Exception;
154+
155+ my $exception = Data::Object::Exception->new;
156+
157+ $exception->throw(['E001', 'Oops!'])
158+
159+ =back
160+
107161=cut
108162
109163=head2 trace
0 commit comments