Rogue Wave Views Data Access Package API Reference Guide |
Rogue Wave Views Documentation Home |
Error Class. More...
#include <ilviews/dataccess/error.h>
Public Types |
Public Member Functions | |
IliErrorMessage () | |
This constructor initializes an undefined error message. | |
IliErrorMessage (Severity severity, Origin origin, IlInt code, const char *message) | |
This constructor initializes an error message. More... | |
IliErrorMessage (const IliErrorMessage &) | |
This constructor copies an error message. | |
IlInt | getCode () const |
Returns the error code of the error message. More... | |
const char * | getMessage () const |
Returns the descriptive message of the error. More... | |
Origin | getOrigin () const |
Returns the origin of the error message. More... | |
Severity | getSeverity () const |
Returns the severity of the error message. More... | |
IlBoolean | isAnError () const |
Returns IlTrue if the severity of the error message is Error . More... | |
IlBoolean | isAWarning () const |
Returns IlTrue if the severity of the error message is Warning . More... | |
IlBoolean | isDefined () const |
Returns IlTrue if the error message is defined. More... | |
IliErrorMessage & | operator= (const IliErrorMessage &msg) |
Assigns an error message. More... | |
void | prettyPrint (IliString &dst) const |
Format error messages in an easily readable string. More... | |
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. More... | |
void | setApplicationError (const char *msg) |
Sets an application message error. More... | |
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. More... | |
static void | ConnectToMessageDatabase (IlvDisplay *) |
This static member function calls the ReadMessageDatabase() member function. More... | |
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. More... | |
static void | RemoveErrorSink (IliErrorSink *sink) |
Removes a global error sink. More... | |
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.
IliErrorList
, IliErrorReporter
, IliErrorSink
, IliErrorCodeTag
.Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue()
, IlvValueInterface::queryValues()
, IlvValueInterface::changeValue()
, IlvValueInterface::changeValues()
. This class defines the following accessors:
Name | Type | Equivalent methods |
---|---|---|
code | Int | getCode() , set(...) |
message | String | getMessage() , set(...) |
origin | Object | getOrigin() , set(...) |
prettyMessage | String | prettyPrint() |
severity | Object | getSeverity() , set(...) |
Here is an example of using an IliErrorMessage
object in Rogue Wave Views Script:
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 |
Adds a global error sink.
When an error message is created, it will be forwarded to this error sink.
sink | The error sink. |
|
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. |
void IliErrorMessage::prettyPrint | ( | IliString & | dst | ) | const |
Format error messages in an easily readable string.
dst | The string where the output is written. |
|
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 |
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
msg | The error message. |
© Copyright 2016, 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.