comments specifying how these traits are applied, just to keep it straight
[gitmo/MooseX-StrictConstructor.git] / lib / MooseX / StrictConstructor / Trait / Method / Constructor.pm
index 3c228b0..da0c4d3 100644 (file)
@@ -1,11 +1,12 @@
 package MooseX::StrictConstructor::Trait::Method::Constructor;
 
+# applied as class_metaroles => { constructor => [ __PACKAGE__ ] }, for older Moose
+
 use Moose::Role;
 
 use namespace::autoclean;
 
 use B ();
-use Carp ();
 
 around '_generate_BUILDALL' => sub {
     my $orig = shift;
@@ -27,7 +28,7 @@ my \%attrs = (@attrs);
 my \@bad = sort grep { ! \$attrs{\$_} }  keys \%{ \$params };
 
 if (\@bad) {
-    Carp::confess "Found unknown attribute(s) passed to the constructor: \@bad";
+    Moose->throw_error("Found unknown attribute(s) passed to the constructor: \@bad");
 }
 EOF