Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HBCI::Error Class Reference

This class is thrown when an error occurs. More...

#include <error.h>

List of all members.

Public Methods

 Error ()
 Error (string where, string message, int code)
 Error (string where, ErrorLevel level, int code, ErrorAdvise advise, string message, string info="")
 Error (const string &where, const Error &err)
 ~Error ()
bool isOk () const
const string & where () const
int code () const
const string & message () const
ErrorLevel level () const
ErrorAdvise advise () const
const string & info () const
string errorString () const


Detailed Description

This class is thrown when an error occurs.

An object of this class is thrown as an exception if an error occurs in OpenHBCI.

Author:
Martin Preuss<openhbci@aquamaniac.de>


Constructor & Destructor Documentation

HBCI::Error::Error  
 

Empty constructor, representing "no error".

Use this to return an error code that says "All Ok." You can check if there was an error by calling isOk().

Author:
Martin Preuss<openhbci@aquamaniac.de>

HBCI::Error::Error string    where,
string    message,
int    code
 

DEPRECATED. This is the old, deprecated constructor. Please use the new, more precise constructor. This one here might be removed soon.

Author:
Martin Preuss<openhbci@aquamaniac.de>

HBCI::Error::Error string    where,
ErrorLevel    level,
int    code,
ErrorAdvise    advise,
string    message,
string    info = ""
 

New constructor, taken from my other projects as they proofed to be valuable.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Parameters:
where  String that describes the location of the error (like "MyClass::myMethod()")
level  Severity level, can be one of
  • ERROR_LEVEL_NONE: no error
  • ERROR_LEVEL_EASY: unimportant error, warning
  • ERROR_LEVEL_NORMAL: normal error
  • ERROR_LEVEL_CRITICAL: critical error
  • ERROR_LEVEL_PANIC: very, very critical error
  • ERROR_LEVEL_INTERNAL: internal error
code  any integer code you want to assign. Some of these codes (starting from integer number 100) have been specified for very specific conditions in OpenHBCI now -- see ErrorCodes .
advise  Proposed reaction to this error, can be one of
  • ERROR_ADVISE_DONTKNOW: unknown, unspecified
  • ERROR_ADVISE_IGNORE: ignore this error
  • ERROR_ADVISE_RETRY: retry the last operation
  • ERROR_ADVISE_ABORT: it does not make sense to continue or retry
  • ERROR_ADVISE_SHUTDOWN: stop the program
message  A short string describing the error.
info  Additional information, for debugging purposes.

HBCI::Error::Error const string &    where,
const Error &    err
 

This constructor can be used to return an error which occurred in a called method. If this one is used, the given string will added to the reporter list of the error. Example:

  • Method A calls method B
  • Method B is maybe called by multiple other Methods
  • Method B returns an error
You now would have two possibilities:
  • return the error returned by Method B
  • return a new error, telling the caller of Method A that there was an error in Method B
With this constructor Method A is able to return an error telling that
  • an error occurred
  • the error occurred in Method B (returning all information Method B provided)
  • this error occurred Method B was called by Method A
So this constructor allows to build up an error chain, so that the debugging person is able to follow the steps that lead to this error by inspecting the "reporter" list. If the error referred to is already an error, that has been reported using this constructor then the new reporter is simply added to the list of reporters (to form the chain).
Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
where  the location which encountered the error reported
err  the error that occurred first place

HBCI::Error::~Error  
 


Member Function Documentation

ErrorAdvise HBCI::Error::advise   const [inline]
 

Returns an advise upon this error (0 if no advise)

Author:
Martin Preuss<openhbci@aquamaniac.de>

int HBCI::Error::code   const [inline]
 

Returns the error code. Some of these codes (starting from integer number 100) have been specified for very specific conditions in OpenHBCI now -- see ErrorCodes.

See also:
ErrorCodes

string HBCI::Error::errorString   const
 

Returns a short error string containing all important information.

Author:
Martin Preuss<openhbci@aquamaniac.de>

const string& HBCI::Error::info   const [inline]
 

Returns additional info about the error.

Author:
Martin Preuss<openhbci@aquamaniac.de>

bool HBCI::Error::isOk   const [inline]
 

Tells you if this object shows an error or if all was ok.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
true if there was no error, false otherwise

ErrorLevel HBCI::Error::level   const [inline]
 

Returns the severity of the error.

Author:
Martin Preuss<openhbci@aquamaniac.de>

const string& HBCI::Error::message   const [inline]
 

Returns the error message itself (e.g. "Bad filename").

Author:
Martin Preuss<openhbci@aquamaniac.de>

const string& HBCI::Error::where   const [inline]
 

Return the location of the error, e.g. "c_error::c_error()".

Author:
Martin Preuss<openhbci@aquamaniac.de>


The documentation for this class was generated from the following file:
Generated on Mon Jun 23 13:41:09 2003 for openhbci by doxygen1.2.17