* Use Moose's throw_error() method.
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt.pm
index b96edfb..59e32a7 100644 (file)
@@ -6,12 +6,10 @@ use MooseX::Getopt::OptionTypeMap;
 use MooseX::Getopt::Meta::Attribute;
 use MooseX::Getopt::Meta::Attribute::NoGetopt;
 
-use Carp ();
-
 use Getopt::Long (); # GLD uses it anyway, doesn't hurt
 use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive };
 
-our $VERSION   = '0.14';
+our $VERSION   = '0.15';
 our $AUTHORITY = 'cpan:STEVAN';
 
 has ARGV       => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt");
@@ -40,7 +38,7 @@ sub new_with_options {
 
     my $constructor_params = ( @params == 1 ? $params[0] : {@params} );
     
-    Carp::croak("Single parameters to new_with_options() must be a HASH ref")
+    $class->throw_error("Single parameters to new_with_options() must be a HASH ref")
         unless ref($constructor_params) eq 'HASH';
 
     my %processed = $class->_parse_argv(