Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / SL / Dispatcher.pm
index 93d3a18..01b6aff 100644 (file)
@@ -16,6 +16,7 @@ BEGIN {
   unshift @INC, $exe_dir;
 }
 
+use Carp;
 use CGI qw( -no_xhtml);
 use Config::Std;
 use DateTime;
@@ -128,6 +129,8 @@ sub pre_startup_setup {
     $::lxdebug->warn(@_);
   };
 
+  $SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die};
+
   $self->_cache_file_modification_times;
 }
 
@@ -283,7 +286,7 @@ sub handle_request {
 
     1;
   } or do {
-    if ($EVAL_ERROR ne END_OF_REQUEST) {
+    if (substr($EVAL_ERROR, 0, length(END_OF_REQUEST())) ne END_OF_REQUEST()) {
       my $error = $EVAL_ERROR;
       print STDERR $error;