#include <d_Error.h>
Public Types | |
| typedef d_Long | kind |
Public Methods | |
| d_Error () | |
| d_Error (kind iKind) | |
| d_Error (const d_Error &iSource) | |
| ~d_Error () | |
| virtual const char * | what () const throw () |
| kind | get_kind () |
| void | set_kind (kind iKind) |
| d_Error * | get_detail () |
| void | set_detail (d_Error *iDetail) |
| bool | contains (kind iKind) |
| d_Error & | operator<< (const d_String &iInfo) |
| d_Error & | operator<< (d_ULong iInfo) |
| d_Error & | operator<< (const char *iInfo) |
| d_Error & | operator<< (const d_Error &iInfo) |
Orient exceptions are treated by raising d_Error objects.
For this reason each database operation (object management, queries, etc.) had to be included inside a C++ try-catch block. This means that there is no need to check the result at every database operation, but rather exception raised in a try block will be handled in the catch block (full C++ integration).
It inherits from C++ exception class.
LOCATION: d_Error.h
USAGE: try { ... } catch( d_Error* <err-object> ) { ... }
Where:
<ERR-OBJECT>: NAME OF D_ERROR OBJECT CAUGHT.
EXAMPLES: try { ... db.open( "business" ); ... } catch( d_Error* err ) { * CATCH DATABASE ERRORS cerr << "Database error :";
* SWITCHING ERROR KIND switch( err->get_kind() ) { case d_Error::d_Error_DatabaseOpen: cerr << "Database not open"; break;
default: cerr << "Generic"; } delete err; }
ODMG: Compliant
|
|
|
|
|
Default Constructor. ODMG : Compliant |
|
|
Create a d_Error object specifying error kind. Create a d_Error object with error kind equal to . ODMG : Compliant |
|
|
Copy Constructor. ODMG : Compliant |
|
|
Destructor. ODMG : Compliant |
|
|
Check if contains the kind requested in the current object and in the detail objects. ODMG : Extension |
|
|
Get the Detail error if any, otherwise null. ODMG : Extension |
|
|
Returns error's kind. ODMG : Compliant |
|
|
Append the message of another d_Error object. ODMG : Compliant |
|
|
Append a c-string to the error message. ODMG : Compliant |
|
|
Append a integer to the error message. ODMG : Compliant |
|
|
Append a string to the error message. ODMG : Compliant |
|
|
Set the Detail error. ODMG : Extension |
|
|
Set error's kind. ODMG : Compliant |
|
|
Returns a message that describes the error. ODMG : Compliant |
1.3-rc1