From 63ca48e18a8429edefc63b28621959cc87d4f8e1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 6 Aug 2007 13:38:32 +0000 Subject: (bug_handler) make it more readable --- perl-install/standalone.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'perl-install/standalone.pm') diff --git a/perl-install/standalone.pm b/perl-install/standalone.pm index f82c2509c..a4bb48969 100644 --- a/perl-install/standalone.pm +++ b/perl-install/standalone.pm @@ -189,16 +189,21 @@ our @drakx_modules = qw(Xconfig::card Xconfig::default Xconfig::main Xconfig::mo sub bug_handler { my ($error) = @_; + # exceptions in eval are OK: return if $error && $^S; + # exceptions with "\n" are normal ways to quit: if ($error eq MDK::Common::String::formatError($error)) { warn $error; exit(255); } + # we want the full backtrace: $error .= common::backtrace() if $error; + my $progname = $0; + # do not loop if drakbug crashes and do not complain about wizcancel: if ($progname =~ /drakbug/ || $error =~ /wizcancel/) { warn $error; @@ -207,6 +212,7 @@ sub bug_handler { $progname =~ s|.*/||; exec('drakbug', if_($error, '--error', $error), '--incident', $progname,); } + $SIG{SEGV} = \&bug_handler; $SIG{__DIE__} = \&bug_handler; -- cgit v1.2.1