Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Error Class. More...
#include <ilviews/dataccess/error.h>
Public Types | |
enum | Origin { UnknownOrigin, DbmsServer, DbmsClientAPI, DbLink, DataAccess, Application } |
The origin of the message. More... | |
enum | Severity { NotAnError, Warning, Error } |
The severity of the message. More... | |
Public Member Functions | |
IliErrorMessage (const IliErrorMessage &) | |
This constructor copies an error message. | |
IliErrorMessage (Severity severity, Origin origin, IlInt code, const char *message) | |
This constructor initializes an error message. | |
IliErrorMessage () | |
This constructor initializes an undefined error message. | |
IlInt | getCode () const |
Returns the error code of the error message. | |
const char * | getMessage () const |
Returns the descriptive message of the error. | |
Origin | getOrigin () const |
Returns the origin of the error message. | |
Severity | getSeverity () const |
Returns the severity of the error message. | |
IlBoolean | isAnError () const |
Returns IlTrue if the severity of the error message is Error . | |
IlBoolean | isAWarning () const |
Returns IlTrue if the severity of the error message is Warning . | |
IlBoolean | isDefined () const |
Returns IlTrue if the error message is defined. | |
IliErrorMessage & | operator= (const IliErrorMessage &msg) |
Assigns an error message. | |
void | realize () const |
Forwards the error message to all the global error sinks that have been added with the addErrorSink static member function. | |
void | set (Severity severity, Origin origin, IlInt code, const char *message) |
Resets the error message properties. | |
void | setApplicationError (const char *msg) |
Sets an application message error. | |
void | unset () |
Resets all properties so that the error message becomes undefined. | |
Static Public Member Functions | |
static void | AddErrorSink (IliErrorSink *sink) |
Adds a global error sink. | |
static void | ConnectToMessageDatabase (IlvDisplay *) |
This static member function calls the ReadMessageDatabase member function. | |
static void | ReadMessageDatabase (IlvDisplay *display) |
This static member function takes into account the translations for error messages that are currently in effect in the display message database. | |
static void | RemoveErrorSink (IliErrorSink *) |
Removes a global error sink. |
Error Class.
Library: dataccess
The IliErrorMessage
class is used to describe errors that occur during program execution. Errors may originate from different sources, such as the database server, the database client library, the Rogue Wave Views DB Link library, the Rogue Wave Views Data Access library, or the application itself. Each error message holds an error code whose meaning depends on the layer that triggered the error, and some descriptive text.
The origin of the message.
IliErrorMessage::IliErrorMessage | ( | Severity | severity, | |
Origin | origin, | |||
IlInt | code, | |||
const char * | message | |||
) |
This constructor initializes an error message.
severity | The severity. | |
origin | The origin. | |
code | The code. | |
message | The message. |
static void IliErrorMessage::AddErrorSink | ( | IliErrorSink * | sink | ) | [static] |
Adds a global error sink.
When an error message is created, it will be forwarded to this error sink.
sink | The error sink. |
static void IliErrorMessage::ConnectToMessageDatabase | ( | IlvDisplay * | ) | [static] |
This static member function calls the ReadMessageDatabase
member function.
In addition, it installs a language change hook into the display that will call the ReadMessageDatabase
member function again each time a new language is made current.
IlInt IliErrorMessage::getCode | ( | ) | const |
Returns the error code of the error message.
const char* IliErrorMessage::getMessage | ( | ) | const |
Returns the descriptive message of the error.
Origin IliErrorMessage::getOrigin | ( | ) | const |
Returns the origin of the error message.
Severity IliErrorMessage::getSeverity | ( | ) | const |
Returns the severity of the error message.
IlBoolean IliErrorMessage::isAnError | ( | ) | const |
Returns IlTrue
if the severity
of the error message is Error
.
IlTrue
if the severity
of the error message is Error
. IlBoolean IliErrorMessage::isAWarning | ( | ) | const |
Returns IlTrue
if the severity
of the error message is Warning
.
IlTrue
if the severity
of the error message is Warning
. IlBoolean IliErrorMessage::isDefined | ( | ) | const |
Returns IlTrue
if the error message is defined.
IlTrue
if the error message is defined. IliErrorMessage& IliErrorMessage::operator= | ( | const IliErrorMessage & | msg | ) |
Assigns an error message.
msg | The new message. |
static void IliErrorMessage::ReadMessageDatabase | ( | IlvDisplay * | display | ) | [static] |
This static member function takes into account the translations for error messages that are currently in effect in the display message database.
This member function should be called after the dataccess/dataccess.dbm
message database file has been read by the display.
static void IliErrorMessage::RemoveErrorSink | ( | IliErrorSink * | ) | [static] |
Removes a global error sink.
sink | The error sink. |
Resets the error message properties.
severity | The severity. | |
origin | The origin. | |
code | The code. | |
message | The message. |
void IliErrorMessage::setApplicationError | ( | const char * | msg | ) |
Sets an application message error.
Calling this member function is equivalent to calling
set(Error, Application, 0, message);
msg | The error message. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.