Skip to content

Commit 48ff640

Browse files
committed
Built release version 2.02
1 parent 3fc2143 commit 48ff640

File tree

3 files changed

+97
-4
lines changed

3 files changed

+97
-4
lines changed

CHANGES

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
11
Changelog for Data-Object-Exception
2+
3+
2.02 2020-03-14T23:15:07
4+
- Added release updates
5+
- Support setting all attributes using "throw"
6+
- Document attributes
7+
8+
2.01 2020-02-17T05:23:11
9+
- Built release version 2.01
10+
- Added release updates
11+
- Re-releasing to the CPAN
12+
13+
2.00 2020-02-04T03:37:30
14+
- Built release version 2.00
15+
- Added release updates
16+
- Update release script and workflow
17+
- Extract from framework
18+
- Initial commit

README

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ SCENARIOS
4343

4444
The package allows objects to be instantiated with key-value arguments.
4545

46+
ATTRIBUTES
47+
48+
This package has the following attributes:
49+
50+
context
51+
52+
context(Any)
53+
54+
This attribute is read-only, accepts (Any) values, and is optional.
55+
56+
id
57+
58+
id(Str)
59+
60+
This attribute is read-only, accepts (Str) values, and is optional.
61+
62+
message
63+
64+
message(Str)
65+
66+
This attribute is read-only, accepts (Str) values, and is optional.
67+
4668
METHODS
4769

4870
This package implements the following methods:
@@ -63,18 +85,34 @@ METHODS
6385

6486
throw
6587

66-
throw(Str $class, Any $context, Maybe[Number] $offset) : Any
88+
throw(Tuple[Str, Str] | Str $message, Any $context, Maybe[Number] $offset) : Any
6789

68-
The throw method throws an error with message.
90+
The throw method throws an error with message (and optionally, an ID).
6991

7092
throw example #1
7193

7294
use Data::Object::Exception;
7395

96+
my $exception = Data::Object::Exception->new;
97+
98+
$exception->throw('Oops!')
99+
100+
throw example #2
101+
102+
use Data::Object::Exception;
103+
74104
my $exception = Data::Object::Exception->new('Oops!');
75105

76106
$exception->throw
77107

108+
throw example #3
109+
110+
use Data::Object::Exception;
111+
112+
my $exception = Data::Object::Exception->new;
113+
114+
$exception->throw(['E001', 'Oops!'])
115+
78116
trace
79117

80118
trace(Int $offset, $Int $limit) : Object

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ The package allows objects to be instantiated with a single argument.
4343

4444
The package allows objects to be instantiated with key-value arguments.
4545

46+
# ATTRIBUTES
47+
48+
This package has the following attributes:
49+
50+
## context
51+
52+
context(Any)
53+
54+
This attribute is read-only, accepts `(Any)` values, and is optional.
55+
56+
## id
57+
58+
id(Str)
59+
60+
This attribute is read-only, accepts `(Str)` values, and is optional.
61+
62+
## message
63+
64+
message(Str)
65+
66+
This attribute is read-only, accepts `(Str)` values, and is optional.
67+
4668
# METHODS
4769

4870
This package implements the following methods:
@@ -63,18 +85,34 @@ The explain method returns an error message with stack trace.
6385

6486
## throw
6587

66-
throw(Str $class, Any $context, Maybe[Number] $offset) : Any
88+
throw(Tuple[Str, Str] | Str $message, Any $context, Maybe[Number] $offset) : Any
6789

68-
The throw method throws an error with message.
90+
The throw method throws an error with message (and optionally, an ID).
6991

7092
- throw example #1
7193

7294
use Data::Object::Exception;
7395

96+
my $exception = Data::Object::Exception->new;
97+
98+
$exception->throw('Oops!')
99+
100+
- throw example #2
101+
102+
use Data::Object::Exception;
103+
74104
my $exception = Data::Object::Exception->new('Oops!');
75105

76106
$exception->throw
77107

108+
- throw example #3
109+
110+
use Data::Object::Exception;
111+
112+
my $exception = Data::Object::Exception->new;
113+
114+
$exception->throw(['E001', 'Oops!'])
115+
78116
## trace
79117

80118
trace(Int $offset, $Int $limit) : Object

0 commit comments

Comments
 (0)