X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=lib%2FZOOM.pod;h=e3c64169aee6f980b62e8ebcd8f6612cf3bc0a0d;hb=00c00e99543145f444acb9802dc92802e355c78b;hp=1b62c13910173611ed5551cde855ba3d979c7b68;hpb=2c373f3192f332f1c407d0b428ad63a590cec2ed;p=ZOOM-Perl-moved-to-github.git diff --git a/lib/ZOOM.pod b/lib/ZOOM.pod index 1b62c13..e3c6416 100644 --- a/lib/ZOOM.pod +++ b/lib/ZOOM.pod @@ -1,4 +1,4 @@ -# $Id: ZOOM.pod,v 1.40 2006-11-03 09:49:38 mike Exp $ +# $Id: ZOOM.pod,v 1.41 2006-12-01 14:11:21 mike Exp $ use strict; use warnings; @@ -636,6 +636,34 @@ http://zoom.z3950.org/api/zoom-current.html#3.5 =head3 Methods +=head4 error() / exception() + + if ($rec->error()) { + my($code, $msg, $addinfo, $dset) = $rec->error(); + print "error $code, $msg ($addinfo) from $dset set\n"; + die $rec->exception(); + } + +These functions test for surrogate diagnostics associated with a +record: that is, errors pertaining to a particular record rather than +to the fetch-some-records operation as a whole. (The latter are known +in Z39.50 as non-surrogate diagnostics, and are reported as exceptions +thrown by searches.) If a particular record can't be obtained - for +example, because it is not available in the requested record syntax - +then the record object obtained from the result-set, when interrogated +with these functions, will report the error. + +C returns the error-code, a human-readable message, +additional information and the name of the diagnostic set that the +error is from. When called in a scalar context, it just returns the +error-code. Since error 0 means "no error", it can be used as a +boolean has-there-been-an-error indicator. + +C returns the same information in the form of a +C object which may be thrown or rendered. If no +error occurred on the record, then C returns an undefined +value. + =head4 render() print $rec->render(); @@ -1275,7 +1303,7 @@ C, C, C, C, -C, +C, C, C, C,