Views
Data Access Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IliErrorList Class Reference

Error Class. More...

#include <ilviews/dataccess/error.h>

Inheritance diagram for IliErrorList:
IliErrorSink

Public Member Functions

 IliErrorList ()
 This constructor initializes an empty error list.
 
 IliErrorList (const IliErrorList &)
 This constructor copies an error list.
 
virtual void addError (const IliErrorMessage &msg)
 Records the error message. More...
 
void append (const IliErrorList &list)
 Appends all the errors recorded in an error list to the end of this error list. More...
 
const IliErrorMessagegetErrorAt (IlInt pos) const
 Returns an error message. More...
 
IlInt getErrorsCount () const
 Returns the count of recorded error messages. More...
 
IliErrorListoperator= (const IliErrorList &list)
 Assigns an error list. More...
 
void removeAllErrors ()
 Removes all errors from the error list.
 
void removeErrorAt (IlInt pos)
 Removes an error message. More...
 
- Public Member Functions inherited from IliErrorSink
 IliErrorSink ()
 This constructor initializes an error sink.
 
 IliErrorSink (const IliErrorSink &)
 This constructor copies an error sink.
 
IliErrorSinkoperator= (const IliErrorSink &sink)
 Assigns an error sink. More...
 

Detailed Description

Error Class.

Library: dataccess

The IliErrorList is a subclass of the IliErrorSink class that keeps a record of all the error messages it catches. Member functions are provided to browse through the recorded error messages or alter them.

See also
IliErrorMessage, IliErrorReporter, IliErrorSink.

Accessors\nAccessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods <tt>IlvValueInterface::queryValue()</tt>, <tt>IlvValueInterface::queryValues()</tt>, <tt>IlvValueInterface::changeValue()</tt>, <tt>IlvValueInterface::changeValues()</tt>.\n\nThis class defines the following accessors:

Data accessors

Name Type Equivalent methods
errorsCount Int getErrorsCount()

Method accessors

Name Return type Equivalent methods
addError(IliErrorMessage msg) Void addError(msg)
appendErrorList(IliErrorList list) Void append(list)
getErrorAt(Int index) IliErrorMessage getErrorAt(index)
removeAllErrors() Void removeAllErrors()
report(IlvAbstractView view) Void defaultErrorReporter.reportErrors(view)

Here is an example of using an IliErrorList object :

var list = new IliErrorList();
var ds = Application.EMP_PNL.EMP_DS;
var i;
ds.addErrorSink(list);
// do some interesting work with ds
// ...
ds.removeErrorSink(list);
for (i = 0; i < list.errorsCount; ++i) {
writeln(list.getErrorAt(i).prettyMessage);
}

Member Function Documentation

◆ addError()

virtual void IliErrorList::addError ( const IliErrorMessage msg)
virtual

Records the error message.

Parameters
msgThe error message.

Reimplemented from IliErrorSink.

◆ append()

void IliErrorList::append ( const IliErrorList list)

Appends all the errors recorded in an error list to the end of this error list.

Parameters
listThe error list

◆ getErrorAt()

const IliErrorMessage& IliErrorList::getErrorAt ( IlInt  pos) const

Returns an error message.

Parameters
posThe message position (counting from 0 for the first message caught).
Returns
The error message.

◆ getErrorsCount()

IlInt IliErrorList::getErrorsCount ( ) const

Returns the count of recorded error messages.

Returns
The count.

◆ operator=()

IliErrorList& IliErrorList::operator= ( const IliErrorList list)

Assigns an error list.

Parameters
listThe error list.

◆ removeErrorAt()

void IliErrorList::removeErrorAt ( IlInt  pos)

Removes an error message.

Parameters
posThe error message position.
IliErrorList::IliErrorList
IliErrorList()
This constructor initializes an empty error list.
Definition: error.h:413
IliDataSource::addErrorSink
void addErrorSink(IliErrorSink *sink)
Adds an error sink.