use Moose;
- has error => (
+ has message => (
is => 'ro',
isa => 'Str',
required => 1,
my ( $self, %params ) = @_;
my $exception = My::Exception->new(
- error => $params{message},
+ message => $params{message},
line => $params{line},
file => $params{file},
package => $params{pack},
'got exception object (immutable class)'
);
is(
- $error->error, 'Attribute (test1) is required',
+ $error->message, 'Attribute (test1) is required',
'got the right message (immutable class)'
);
is(
isa_ok( $error, 'My::Exception', 'got exception object (mutable class)' );
is(
- $error->error, 'Attribute (test1) is required',
+ $error->message, 'Attribute (test1) is required',
'got the right message (mutable class)'
);
}