Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.11 Error Messages: Contents of RWDBStatus

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.

2.11.1 Reporting 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.

Sybase Client-Library error messages are made available only in debug mode; CS-Library errors are available in all build types.

2.11.2 Reporting Errors from Adaptive Server

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.

Server errors are made available in all build types.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.