some changes to work the next Moose, making constructor inlining work
[gitmo/MooseX-Singleton.git] / lib / MooseX / Singleton / Meta / Method / Constructor.pm
index 520483a..e95e318 100644 (file)
@@ -64,11 +64,18 @@ sub initialize_body {
         } @type_constraints;
 
         $code = eval $source;
-        confess "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@" if $@;
+        $self->throw_error(
+            "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@",
+            error => $@, data => $source )
+            if $@;
     }
     $self->{'body'} = $code;
 }
 
+sub _expected_constructor_class {
+    return 'MooseX::Singleton::Object';
+}
+
 no Moose;
 
 1;