Created
October 15, 2010 23:56
-
-
Save marcusramberg/629173 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Moose/Error/Default.pm b/lib/Moose/Error/Default.pm | |
index 0c81d0e..9588c65 100644 | |
--- a/lib/Moose/Error/Default.pm | |
+++ b/lib/Moose/Error/Default.pm | |
@@ -16,7 +16,12 @@ Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); | |
sub new { | |
my ( $self, @args ) = @_; | |
- $self->create_error_confess( @args ); | |
+ if(exists $ENV{MOOSE_CROAK} && $ENV{MOOSE_CROAK}) { | |
+ $self->create_error_confess( @args ); | |
+ } | |
+ else { | |
+ $self->create_error_croak( @args ); | |
+ } | |
} | |
sub create_error_croak { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment