Summary
This chapter presented the following information about the error model used in SourcePro DB:
The error model of SourcePro DB 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 has a new error to report, its error handler is invoked.
Applications can handle errors inline, by installing an error handler, or by raising C++ exceptions.
Applications written with SourcePro DB 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.
Most objects of SourcePro DB 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.