[Bps-public-commit] r14144 - in sd/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Wed Jul 16 00:41:18 EDT 2008


Author: sartak
Date: Wed Jul 16 00:41:14 2008
New Revision: 14144

Modified:
   sd/trunk/   (props changed)
   sd/trunk/bin/sd

Log:
 r64355 at onn:  sartak | 2008-07-16 00:41:03 -0400
 Strip subsequent lines in "die" unless $ENV{SD_VERBOSE_ERROR} is set, because no one but SD hackers will really want the stack trace


Modified: sd/trunk/bin/sd
==============================================================================
--- sd/trunk/bin/sd	(original)
+++ sd/trunk/bin/sd	Wed Jul 16 00:41:14 2008
@@ -6,6 +6,18 @@
 
 $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} || $ENV{'HOME'}.'/.sd';
 
+# Moose likes generating very noisy backtraces. Most users don't need to see
+# anything more than the root cause of the failure. Developers and the curious
+# can set environment variable SD_VERBOSE_ERROR to retain the backtraces.
+# When Moose's error throwing is more malleable we should switch to using that.
+unless ($ENV{SD_VERBOSE_ERROR}) {
+    $SIG{__DIE__} = sub {
+        my $line = shift;
+        $line =~ s/\n.*//s;
+        die $line;
+    };
+}
+
 my $cli = Prophet::CLI->new({ app_class => 'App::SD' });
 $cli->run_one_command;
 



More information about the Bps-public-commit mailing list