ZOOM::Error::INIT renamed to ZINIT.
authormike <mike>
Fri, 1 Dec 2006 14:13:41 +0000 (14:13 +0000)
committermike <mike>
Fri, 1 Dec 2006 14:13:41 +0000 (14:13 +0000)
$rec->exception() returns undef if there's no error.

lib/ZOOM.pm

index a88be64..cc0cf8e 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.42 2006-11-28 16:47:19 mike Exp $
+# $Id: ZOOM.pm,v 1.43 2006-12-01 14:13:41 mike Exp $
 
 use strict;
 use warnings;
@@ -34,7 +34,7 @@ sub MEMORY { Net::Z3950::ZOOM::ERROR_MEMORY }
 sub ENCODE { Net::Z3950::ZOOM::ERROR_ENCODE }
 sub DECODE { Net::Z3950::ZOOM::ERROR_DECODE }
 sub CONNECTION_LOST { Net::Z3950::ZOOM::ERROR_CONNECTION_LOST }
-sub INIT { Net::Z3950::ZOOM::ERROR_INIT }
+sub ZINIT { Net::Z3950::ZOOM::ERROR_INIT }
 sub INTERNAL { Net::Z3950::ZOOM::ERROR_INTERNAL }
 sub TIMEOUT { Net::Z3950::ZOOM::ERROR_TIMEOUT }
 sub UNSUPPORTED_PROTOCOL { Net::Z3950::ZOOM::ERROR_UNSUPPORTED_PROTOCOL }
@@ -831,6 +831,7 @@ sub exception {
     my $this = shift();
 
     my($errcode, $errmsg, $addinfo, $diagset) = $this->error();
+    return undef if $errcode == 0;
     return new ZOOM::Exception($errcode, $errmsg, $addinfo, $diagset);
 }