Skip to content

Instantly share code, notes, and snippets.

@marcusramberg
Created October 16, 2010 00:18
Show Gist options
  • Save marcusramberg/629199 to your computer and use it in GitHub Desktop.
Save marcusramberg/629199 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..1148c69 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_ERROR_TERSE} && $ENV{MOOSE_ERROR_TERSE}) {
+ $self->create_error_croak( @args );
+ }
+ else {
+ $self->create_error_confess( @args );
+ }
}
sub create_error_croak {
@@ -59,7 +64,8 @@ Moose::Error::Default - L<Carp> based error generation for Moose.
This class implements L<Carp> based error generation.
-The default behavior is like L<Moose::Error::Confess>.
+The default behavior is like L<Moose::Error::Confess>. To override
+this on a system basis, set $ENV{MOOSE_ERROR_TERSE}.
=head1 METHODS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment