![]()
|
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
">ZOOM::exception and subclassesThe base class has this declaration:
It has three concrete subclasses: ZOOM::systemException
ZOOM::bib1Exception
ZOOM::queryException
Revised Sample ProgramNow we can revise the sample program from the introduction to catch exceptions and report any errors:
The heart of this program is the same as in the original version, but it's now wrapped in a try block followed by several catch blocks which try to give helpful diagnostics if something goes wrong. The first such block diagnoses system-level errors such as memory exhaustion or a network connection being broken by a server's untimely death; the second catches errors at the Z39.50 level, such as a server's report that it can't provide records in USMARC syntax; the third is there in case there's something wrong with the syntax of the query (although in this case it's correct); and finally, the last catch block is a belt-and-braces measure to be sure that nothing escapes us. References
Because C does not support exceptions, ZOOM-C has no API element that corresponds directly with ZOOM-C++'s exception class and its subclasses. The closest thing is the ZOOM_connection_error function described in The Connections section of the documentation. |