return wantarray ? %{ $rv } : $rv;
}
else {
- $self->throw_error("Can not auto de-reference the type constraint '" . $type_constraint->name . "'", object => $instance, data => $type_constraint);
+ $self->throw_error("Can not auto de-reference the type constraint '" . $type_constraint->name . "'", object => $instance, type_constraint => $type_constraint);
}
}
Before setting the value, a check is made on the type constraint of
the attribute, if it has one, to see if the value passes it. If the
-value fails to pass, the set operation dies with a L<Carp/confess>.
+value fails to pass, the set operation dies with a L<throw_error>.
Any coercion to convert values is done before checking the type constraint.
$sigil = '%';
}
else {
- $self->throw_error("Can not auto de-reference the type constraint '" . $type_constraint->name . "'", data => $type_constraint );
+ $self->throw_error("Can not auto de-reference the type constraint '" . $type_constraint->name . "'", type_constraint => $type_constraint );
}
"(wantarray() ? $sigil\{ ( $ref_value ) || return } : ( $ref_value ) )";
use strict;
use warnings;
-use Carp 'confess';
-
our $VERSION = '0.57';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
use strict;
use warnings;
-use Carp 'confess';
use Scalar::Util 'blessed', 'weaken';
our $VERSION = '0.57';
my $class = shift;
my %options = @_;
- (exists $options{options} && ref $options{options} eq 'HASH')
- || confess "You must pass a hash of options";
-
+ (ref $options{options} eq 'HASH')
+ || $class->throw_error("You must pass a hash of options", data => $options{options});
+
($options{package_name} && $options{name})
- || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT";
-
+ || $class->throw_error("You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT");
+
my $self = bless {
# from our superclass
'body' => undef,
# then must pass in a class name
unless (blessed $self) {
(blessed $_[0] && $_[0]->isa('Class::MOP::Class'))
- || confess "When calling is_needed as a class method you must pass a class name";
+ || $self->throw_error("When calling is_needed as a class method you must pass a class name");
return $_[0]->meta->can('DEMOLISH');
}
defined $self->{'body'} ? 1 : 0
my $code;
{
$code = eval $source;
- confess "Could not eval the destructor :\n\n$source\n\nbecause :\n\n$@" if $@;
+ $self->throw_error("Could not eval the destructor :\n\n$source\n\nbecause :\n\n$@", error => $@, data => $source) if $@;
}
$self->{'body'} = $code;
}
use if ( not our $__mx_is_compiled ), 'Moose::Meta::Class';
use if ( not our $__mx_is_compiled ), metaclass => 'Moose::Meta::Class';
-use Carp 'confess';
-
our $VERSION = '0.57';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';