From: Piotr Roszatycki Date: Fri, 24 Oct 2008 21:03:56 +0000 (+0000) Subject: * Use Moose's throw_error() method. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d9cc914c6085c8666a8ea08b67cdda0413f0efa;p=gitmo%2FMooseX-Getopt.git * Use Moose's throw_error() method. --- diff --git a/ChangeLog b/ChangeLog index 13b0379..7477c6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ Revision history for Perl extension MooseX-Getopt +0.150001 ??? + * MooseX::Getopt + - Use Moose's throw_error() method. (dexter) + 0.15 Sat. July 26 2008 * MooseX::Getopt::OptionTypeMap - Accept type constraint objects in the type mapping, not just names diff --git a/lib/MooseX/Getopt.pm b/lib/MooseX/Getopt.pm index 541706a..59e32a7 100644 --- a/lib/MooseX/Getopt.pm +++ b/lib/MooseX/Getopt.pm @@ -6,8 +6,6 @@ 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 }; @@ -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(