diff options
Diffstat (limited to 'lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm')
-rw-r--r-- | lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm b/lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm new file mode 100644 index 0000000..e880935 --- /dev/null +++ b/lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm @@ -0,0 +1,18 @@ +package Moose::Exception::CallingReadOnlyMethodOnAnImmutableInstance; +our $VERSION = '2.1405'; + +use Moose; +extends 'Moose::Exception'; + +has 'method_name' => ( + is => 'ro', + isa => 'Str', + required => 1 +); + +sub _build_message { + my $self = shift; + "The '".$self->method_name."' method is read-only when called on an immutable instance"; +} + +1; |