projects
/
ZOOM-Perl-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
840ee7f
)
New ->exception() method£
author
mike
<mike>
Wed, 9 May 2007 12:03:52 +0000
(12:03 +0000)
committer
mike
<mike>
Wed, 9 May 2007 12:03:52 +0000
(12:03 +0000)
Changes
patch
|
blob
|
history
lib/ZOOM.pm
patch
|
blob
|
history
lib/ZOOM.pod
patch
|
blob
|
history
diff --git
a/Changes
b/Changes
index
97f5a67
..
9161ddc
100644
(file)
--- a/
Changes
+++ b/
Changes
@@
-1,8
+1,9
@@
-$Id: Changes,v 1.60 2007-04-18 11:19:10 mike Exp $
+$Id: Changes,v 1.61 2007-05-09 12:03:52 mike Exp $
Revision history for Perl extension Net::Z3950::ZOOM.
1.19 (IN PROGRESS)
Revision history for Perl extension Net::Z3950::ZOOM.
1.19 (IN PROGRESS)
+ - Add $conn->exception() method.
- Set version number for Net::Z3950 to 0.99 -- less than the
1.0 version number that will be used when it successfully
emulates the old Net::Z3950 module, but superseding the last
- Set version number for Net::Z3950 to 0.99 -- less than the
1.0 version number that will be used when it successfully
emulates the old Net::Z3950 module, but superseding the last
diff --git
a/lib/ZOOM.pm
b/lib/ZOOM.pm
index
2b335b4
..
0a42e3e
100644
(file)
--- a/
lib/ZOOM.pm
+++ b/
lib/ZOOM.pm
@@
-1,4
+1,4
@@
-# $Id: ZOOM.pm,v 1.47 2007-02-26 14:52:21 mike Exp $
+# $Id: ZOOM.pm,v 1.48 2007-05-09 12:03:52 mike Exp $
use strict;
use warnings;
use strict;
use warnings;
@@
-402,6
+402,14
@@
sub error_x {
return wantarray() ? ($errcode, $errmsg, $addinfo, $diagset) : $errcode;
}
return wantarray() ? ($errcode, $errmsg, $addinfo, $diagset) : $errcode;
}
+sub exception {
+ my $this = shift();
+
+ my($errcode, $errmsg, $addinfo, $diagset) = $this->error_x();
+ return undef if $errcode == 0;
+ return new ZOOM::Exception($errcode, $errmsg, $addinfo, $diagset);
+}
+
sub errcode {
my $this = shift();
return Net::Z3950::ZOOM::connection_errcode($this->_conn());
sub errcode {
my $this = shift();
return Net::Z3950::ZOOM::connection_errcode($this->_conn());
diff --git
a/lib/ZOOM.pod
b/lib/ZOOM.pod
index
5d63838
..
acc0cce
100644
(file)
--- a/
lib/ZOOM.pod
+++ b/
lib/ZOOM.pod
@@
-1,4
+1,4
@@
-# $Id: ZOOM.pod,v 1.42 2007-02-26 14:40:01 mike Exp $
+# $Id: ZOOM.pod,v 1.43 2007-05-09 12:03:52 mike Exp $
use strict;
use warnings;
use strict;
use warnings;
@@
-305,6
+305,15
@@
returns all four at once.
See the C<ZOOM::Exception> for the interpretation of these elements.
See the C<ZOOM::Exception> for the interpretation of these elements.
+=head4 exception()
+
+ die $conn->exception();
+
+C<exception()> returns the same information as C<error_x()> in the
+form of a C<ZOOM::Exception> object which may be thrown or rendered.
+If no error occurred on the connection, then C<exception()> returns an
+undefined value.
+
=head4 check()
$conn->check();
=head4 check()
$conn->check();