From: Dave Rolsky Date: Mon, 11 Apr 2011 15:32:59 +0000 (-0500) Subject: Use Moose->throw_error to throw errors X-Git-Tag: 2.0100~75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3f9c18f3021ea812bffb5bab7ab47eadbf2b971d;p=gitmo%2FMoose.git Use Moose->throw_error to throw errors --- diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm index 3e370dc..1f657ca 100644 --- a/lib/Moose/Meta/TypeConstraint.pm +++ b/lib/Moose/Meta/TypeConstraint.pm @@ -130,8 +130,10 @@ sub validate { sub _inline_check { my $self = shift; - die 'Cannot inline a type constraint check for ' . $self->name - unless $self->has_inlined_type_constraint; + unless ( $self->has_inlined_type_constraint ) { + require Moose; + Moose->throw_error( 'Cannot inline a type constraint check for ' . $self->name ); + } return $self->inlined->( $self, @_ ); }