summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/CouldNotEvalDestructor.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Moose/Exception/CouldNotEvalDestructor.pm')
-rw-r--r--lib/Moose/Exception/CouldNotEvalDestructor.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/Moose/Exception/CouldNotEvalDestructor.pm b/lib/Moose/Exception/CouldNotEvalDestructor.pm
new file mode 100644
index 0000000..40ad749
--- /dev/null
+++ b/lib/Moose/Exception/CouldNotEvalDestructor.pm
@@ -0,0 +1,33 @@
+package Moose::Exception::CouldNotEvalDestructor;
+our $VERSION = '2.1405';
+
+use Moose;
+extends 'Moose::Exception';
+
+has 'method_destructor_object' => (
+ is => 'ro',
+ isa => 'Moose::Meta::Method::Destructor',
+ required => 1
+);
+
+has 'source' => (
+ is => 'ro',
+ isa => 'Str',
+ required => 1
+);
+
+has 'error' => (
+ is => 'ro',
+ isa => 'Str',
+ required => 1
+);
+
+sub _build_message {
+ my $self = shift;
+ my $error = $self->error;
+ my $source = $self->source;
+
+ return "Could not eval the destructor :\n\n$source\n\nbecause :\n\n$error";
+}
+
+1;