rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliErrorMessage Class Reference

Error Class. More...

#include <ilviews/dataccess/error.h>

List of all members.

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.
IliErrorMessageoperator= (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.

Detailed Description

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.

See also:
IliErrorList, IliErrorReporter, IliErrorSink IliErrorCodeTag

Member Enumeration Documentation

The origin of the message.

Enumerator:
UnknownOrigin 

The origin is unknown.

DbmsServer 

The origin comes from DBMS server.

DbmsClientAPI 

The origin comes from client API.

DbLink 

The origin comes from DbLink.

DataAccess 

The origin comes from Data Access.

Application 

The origin comes from the application.

The severity of the message.

Enumerator:
NotAnError 

It is not an error.

Warning 

It is a warning.

Error 

It is an error.


Constructor & Destructor Documentation

IliErrorMessage::IliErrorMessage ( Severity  severity,
Origin  origin,
IlInt  code,
const char *  message 
)

This constructor initializes an error message.

Parameters:
severity The severity.
origin The origin.
code The code.
message The message.

Member Function Documentation

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.

Parameters:
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.

Returns:
The error code.
const char* IliErrorMessage::getMessage (  )  const

Returns the descriptive message of the error.

Returns:
The descriptive message.
Origin IliErrorMessage::getOrigin (  )  const

Returns the origin of the error message.

Returns:
The origin.
Severity IliErrorMessage::getSeverity (  )  const

Returns the severity of the error message.

Returns:
The severity.
IlBoolean IliErrorMessage::isAnError (  )  const

Returns IlTrue if the severity of the error message is Error.

Returns:
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.

Returns:
IlTrue if the severity of the error message is Warning.
IlBoolean IliErrorMessage::isDefined (  )  const

Returns IlTrue if the error message is defined.

Returns:
IlTrue if the error message is defined.
IliErrorMessage& IliErrorMessage::operator= ( const IliErrorMessage msg  ) 

Assigns an error message.

Parameters:
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.

Parameters:
sink The error sink.
void IliErrorMessage::set ( Severity  severity,
Origin  origin,
IlInt  code,
const char *  message 
)

Resets the error message properties.

Parameters:
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);
Parameters:
msg The error message.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

© 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.