org.z3950.zoom
Class Bib1Exception

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.z3950.zoom.ZOOMException
                    |
                    +--org.z3950.zoom.Bib1Exception
All Implemented Interfaces:
java.io.Serializable

public class Bib1Exception
extends ZOOMException

Represents an error occurring in a Z39.50 Server.

Synopsis:

	try {
	    // deep sequence of calls, one of which does:
		throw new Bib1Exception(238, "xml,sutrs");
	} catch (Bib1Exception ex) {
	    System.err.println("code=" + ex.code());
	    System.err.println("addinfo=" + ex.addinfo());
	}
 

This class is not described in detail in the ZOOM Abstract API, but is hinted at in the discussion of diagnostics for the Connection class. It provides methods for obtaining the diagnostic details returned from the server.

Version:
$Id: Bib1Exception.java,v 1.2 2002/12/14 00:17:49 mike Exp $
See Also:
zoom.z3950.org/api/zoom-1.1.html#3.2.5, Serialized Form

Method Summary
 java.lang.String addinfo()
          Returns any additional information provided by the server concerning the error that is specified by the errcode() method.
 int errcode()
          Returns the BIB1 diagnostic code of the error that occurred on the server.
 java.lang.String errmsg()
          Returns a human-readable string corresponding to the BIB1 diagnostic code of the server error as returned by the errcode() method.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

errcode

public int errcode()
Returns the BIB1 diagnostic code of the error that occurred on the server. This is an integer whose interpretation is specified in appendix ERR.1 (Bib-1 Diagnostics) of the Z39.50 standard itself.
Returns:
the BIB1 diagnostic code.
See Also:
Z39.50-1995, Appendix ERR.1, zoom.z3950.org/api/zoom-1.1.html#3.2.5

errmsg

public java.lang.String errmsg()
Returns a human-readable string corresponding to the BIB1 diagnostic code of the server error as returned by the errcode() method.
Returns:
a string describing the BIB1 diagnostic code.
See Also:
zoom.z3950.org/api/zoom-1.1.html#3.2.5

addinfo

public java.lang.String addinfo()
Returns any additional information provided by the server concerning the error that is specified by the errcode() method. Its exact interpretation is dependent on what that diagnostic code is.
Returns:
additional information about the server error.
See Also:
zoom.z3950.org/api/zoom-1.1.html#3.2.5

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable