A throwable class used to store errors on the error stack.
More...
#include <IFail.hxx>
|
| void | getAndClearErrorStack (std::vector< int > &errorCodes, std::vector< int > &severities, std::vector< std::string > &errorMessages) |
| |
| const std::string & | getMessage () const |
| |
| | IFail () |
| |
| | IFail (int ifail, const char *s1=0, const char *s2=0, const char *s3=0, const char *s4=0, const char *s5=0, const char *s6=0, const char *s7=0) |
| |
| | IFail (int ifail, const std::string &s1) |
| |
| | IFail (int ifail, const std::string &s1, const std::string &s2) |
| |
| int | ifail () const |
| |
| | operator int () const |
| |
| | ~IFail () |
| |
A throwable class used to store errors on the error stack.
try
{
[...]
int retCode = POM_get_user( &userName, &vUserTag );
if( retCode!=ITK_ok || vUserTag == NULLTAG )
{
throw IFail(TIE_null_attribute, ValidationResultClassName, VALIDATION_USER);
}
[...]
}
{
[...]
}
Definition at line 49 of file IFail.hxx.
Default constructor.
It uses the last error stored on the error stack.
| IFail::IFail |
( |
int |
ifail, |
|
|
const char * |
s1 = 0, |
|
|
const char * |
s2 = 0, |
|
|
const char * |
s3 = 0, |
|
|
const char * |
s4 = 0, |
|
|
const char * |
s5 = 0, |
|
|
const char * |
s6 = 0, |
|
|
const char * |
s7 = 0 |
|
) |
| |
Constructor of an instance with a provided error code and its associated parameters.
- Parameters
-
| [in] | ifail | The error code |
| [in] | s1 | Substitution for the parameter 1 in the displayable error message. |
| [in] | s2 | Substitution for the parameter 2 in the displayable error message. |
| [in] | s3 | Substitution for the parameter 3 in the displayable error message. |
| [in] | s4 | Substitution for the parameter 4 in the displayable error message. |
| [in] | s5 | Substitution for the parameter 5 in the displayable error message. |
| [in] | s6 | Substitution for the parameter 6 in the displayable error message. |
| [in] | s7 | Substitution for the parameter 7 in the displayable error message. |
| IFail::IFail |
( |
int |
ifail, |
|
|
const std::string & |
s1 |
|
) |
| |
std::string overloads. Add more as required.
| IFail::IFail |
( |
int |
ifail, |
|
|
const std::string & |
s1, |
|
|
const std::string & |
s2 |
|
) |
| |
| IFail::IFail |
( |
bool |
storeError, |
|
|
int |
ifail |
|
) |
| |
|
private |
| void IFail::getAndClearErrorStack |
( |
std::vector< int > & |
errorCodes, |
|
|
std::vector< int > & |
severities, |
|
|
std::vector< std::string > & |
errorMessages |
|
) |
| |
Retrieves the contents of the error stack, and then clears the error stack.
The older error is at the last position of the arrays for this method.
- Note
- The errors are returned in reverse order compared to a call to the EMH_ask_errors.
- Parameters
-
| [in] | errorCodes | The list of error codes on the error stack |
| [in] | severities | The list of severities for each of the errors (#EMH_severity_error, #EMH_severity_warning, or #EMH_severity_information). |
| [in] | errorMessages | The displayable error message for each error. |
| const std::string& IFail::getMessage |
( |
| ) |
const |
Returns a localized message in which all error code parameters have been substituted.
| int IFail::ifail |
( |
| ) |
const |
Retrieves the associated error code.
| IFail::operator int |
( |
| ) |
const |
Retrieves the associated error code.
| std::string IFail::m_message |
|
private |
The documentation for this class was generated from the following file: