Sybase Client-Library distinguishes between errors originating from Adaptive Server and errors generated within Client-Library and CS-Library. DBTools.h++ honors the distinction by assigning error code serverError to errors from Adaptive Server, and error code vendorLib to errors from Client-Library and CS-Library.
The format that RWDBStatus uses to report errors from Client-Library and CS-Library follows this paragraph. Notice that errors with a severity level of zero are given special handling: the RWDBStatus::errorCode is set to RWDBStatus::ok, the rest of the RWDBStatus is populated, and an application's error handler (if any) is invoked. This means that DBTools.h++ applications will ignore these errors by default, but an application can process them if necessary. It also means that the error handler for the application should check vendorError2 (severity) before raising an exception.
errorCode: RWDBStatus::vendorLib, unless the severity is zero, as rated by Client-Library or CS-Library. If severity is zero, errorCode is set to RWDBStatus::ok, and the user-installed error handler is invoked.
message: Vendor Library Error:%s, where %s is the error text from Client-Library or CS-Library (CS_CLIENT_MSG.msgstring).
vendorMessage1: The text reported by Client-Library or CS-Library as an operating system error, if any (CS_CLIENT_MSG.osstring).
vendorMessage2: The text that describes the error (CS_CLIENT_MSG.sqlstate). Not all client messages have state values associated with them.
vendorError1: The Client-Library or CS-Library error number (CS_CLIENT_MSG.msgno).
vendorError2: The error's severity level (CS_CLIENT_MSG.severity).
Sybase Client-Library error messages are made available only in debug mode; CS-Library errors are available in all build types.
The following format shows how RWDBStatus reports messages from Adaptive Server. Notice that RWDBStatus provides special handling for messages that result from SQL PRINT statements (in which both severity and message number are 0) and for context switch messages (for example, Changed database context to master). When these messages occur, the RWDBStatus::errorCode is set to RWDBStatus::ok, the rest of the RWDBStatus is populated, and the application's error handler (if any) is invoked. Because errorCode is RWDBStatus::ok, DBTools.h++ applications will ignore these errors by default. However, the error information itself is still accessible if the application needs to check it. The error handler should check vendorError2 (severity) before raising an exception.
errorCode: RWDBStatus::serverError, unless:
severity and message number are both zero, or
message number is one of: 5701, 5703, 5704.
In either case, errorCode is set to RWDBStatus::ok, and the user-installed error handler is invoked.
message: If severity is not zero, Server Error:%s else Server Messages, where %s is the text of the server message (CS_SERVERMSG.msgtext).
vendorMessage1: Name of the server reporting the error (CS_SERVERMSG.srvname).
vendorMessage2: The text describing the error(CS_SERVERMSG.sqlstate). Not all client messages have state values associated with them.
vendorError1: Server message number (CS_SERVERMSG.msgno).
vendorError2: The error's severity level (CS_SERVERMSG.severity).
Server errors are made available in all build types.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.