This chapter presented the following information about the error model used in DBTools.h++:
The DBTools.h++ error model is based on class RWDBStatus. Instances of class RWDBStatus encapsulate the status of an object or an operation. Every RWDBStatus object has an embedded, user-defined error handler. When an RWDBStatus instance changes status to anything but RWDBStatus::ok, its error handler is invoked.
Applications can handle errors inline by installing an error handler, or by raising C++ exceptions.
Your DBTools.h++ applications can use C++ exceptions or not, as you see fit. The simplest way to use an exception model is to call the raise() method of RWDBStatus from your error handler, resulting in an exception of type RWExternalErr, derived from RWXMsg and XMsg, as per the C++ standard.
Most DBTools.h++ objects have an embedded status. Errors are reported by returning an RWDBStatus, returning an object that contains an RWDBStatus, or by changing the RWDBStatus of the object encountering the error.
Applications that do not need to interpret errors from a database can be written portably. As the level of database specificity of an application increases, its portability decreases.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.