Skip to content

Instantly share code, notes, and snippets.

@marcusramberg
Created October 15, 2010 23:56
Show Gist options
  • Save marcusramberg/629173 to your computer and use it in GitHub Desktop.
Save marcusramberg/629173 to your computer and use it in GitHub Desktop.
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