summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/CouldNotCreateWriter.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Moose/Exception/CouldNotCreateWriter.pm')
-rw-r--r--lib/Moose/Exception/CouldNotCreateWriter.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Moose/Exception/CouldNotCreateWriter.pm b/lib/Moose/Exception/CouldNotCreateWriter.pm
new file mode 100644
index 0000000..8bcb7fb
--- /dev/null
+++ b/lib/Moose/Exception/CouldNotCreateWriter.pm
@@ -0,0 +1,23 @@
+package Moose::Exception::CouldNotCreateWriter;
+our $VERSION = '2.1405';
+
+use Moose;
+extends 'Moose::Exception';
+with 'Moose::Exception::Role::EitherAttributeOrAttributeName', 'Moose::Exception::Role::Instance';
+
+has 'error' => (
+ is => 'ro',
+ isa => 'Str',
+ required => 1
+);
+
+sub _build_message {
+ my $self = shift;
+ my $error = $self->error;
+ my $attribute_name = $self->attribute_name;
+
+ return "Could not create writer for '$attribute_name' "
+ . "because $error";
+}
+
+1;