From 52c52cd4092ca32a71ebcfdabddbd145278c4065 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 13 Feb 2007 15:31:26 +0000 Subject: [PATCH] Support _check_debug options. --- lib/ZOOM.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ZOOM.pm b/lib/ZOOM.pm index 96cfd3c..e99ddc7 100644 --- a/lib/ZOOM.pm +++ b/lib/ZOOM.pm @@ -1,4 +1,4 @@ -# $Id: ZOOM.pm,v 1.44 2007-01-16 11:17:28 mike Exp $ +# $Id: ZOOM.pm,v 1.45 2007-02-13 15:31:26 mike Exp $ use strict; use warnings; @@ -341,8 +341,14 @@ sub _check { my($errcode, $errmsg, $addinfo, $diagset) = (undef, "x", "x", "x"); $errcode = Net::Z3950::ZOOM::connection_error_x($this->_conn(), $errmsg, $addinfo, $diagset); - die new ZOOM::Exception($errcode, $errmsg, $addinfo, $diagset) - if $errcode; + if ($errcode) { + if ($this->option("_check_debug")) { + print STDERR "ZOOM WARNING! $this->check() failed with error $diagset:$errcode ($errmsg) $addinfo\n"; + print STDERR "SIG{SEGV} ", (defined $SIG{SEGV} ? ("= '" . $SIG{SEGV} . "'") : "undefined"), "'\n"; + print STDERR "SIG{__DIE__} ", (defined $SIG{__DIE__} ? ("= '" . $SIG{__DIE__} , "'") : "undefined"), "'\n"; + } + die new ZOOM::Exception($errcode, $errmsg, $addinfo, $diagset); + } } sub create { -- 1.7.10.4