Used to hold the error state and return it to the application. More...
#include <MsqError.hpp>
Classes | |
class | Setter |
class | Trace |
One line of stack trace data. More... | |
Public Member Functions | |
void | clear () |
resets error object to non-active state (no error). More... | |
bool | error () const |
Check if an error has occured. More... | |
operator bool () const | |
Check if an error has occured. More... | |
MsqError () | |
Initialize to cleared state. More... | |
virtual | ~MsqError () |
Destructor - empty but must declar virtual destrucor if virtual functions. More... | |
ErrorCode | error_code () const |
Get error code. More... | |
const char * | error_message () const |
Get error message. More... | |
const StackTrace & | stack () const |
Get stack trace. More... | |
virtual bool | push (const char *function, const char *file, int line) |
Add to back-trace of call stack. More... | |
virtual bool | set_error (ErrorCode num, const char *msg=0) |
Initialize the error object with the passed data. More... | |
void | clear () |
resets error object to non-active state (no error). More... | |
bool | error () const |
Check if an error has occured. More... | |
operator bool () const | |
Check if an error has occured. More... | |
MsqError () | |
Initialize to cleared state. More... | |
virtual | ~MsqError () |
Destructor - empty but must declar virtual destrucor if virtual functions. More... | |
ErrorCode | error_code () const |
Get error code. More... | |
const char * | error_message () const |
Get error message. More... | |
const StackTrace & | stack () const |
Get stack trace. More... | |
virtual bool | push (const char *function, const char *file, int line) |
Add to back-trace of call stack. More... | |
virtual bool | set_error (ErrorCode num, const char *msg=0) |
Initialize the error object with the passed data. More... | |
Static Public Member Functions | |
static Setter | setter (MsqError &err, const char *function, const char *file, int line) |
static Setter | setter (MsqError &err, const char *function, const char *file, int line) |
Private Attributes | |
ErrorCode | errorCode |
msq_std::string | errorMessage |
StackTrace | stackTrace |
Used to hold the error state and return it to the application.
Used to hold error state and related information. Internal Mesquite code should access this object via the MSQ_SETERR and MSQ_CHKERR macros.
For applications, the cast-to-bool operator and << operator are provided for convenient, if simple access to this data. E.g.: if (err) cout << err << endl;
There are two options for an application to gain more detailed access to the error data. The application may either access the data stored in this class via the provided methods or subclass MsqError, overriding set_error and push to handle the error data as it is generated.
Definition at line 106 of file includeLinks/MsqError.hpp.
typedef msq_std::list<Trace> StackTrace |
Container type used to store stack trace.
Return type for stack
Definition at line 173 of file includeLinks/MsqError.hpp.
typedef msq_std::list<Trace> StackTrace |
Container type used to store stack trace.
Return type for stack
Definition at line 173 of file src/Misc/MsqError.hpp.
enum ErrorCode |
Error codes.
Enumerator | |
---|---|
NO_ERROR |
no error |
UNKNOWN_ERROR |
unknown error occured |
OUT_OF_MEMORY |
unable to allocate the necessary memory |
INVALID_ARG |
invalid function argument passed |
NOT_INITIALIZED |
object not initialized |
INVALID_STATE |
object is in an invalid state |
FILE_ACCESS |
File cannot be opened/created. |
FILE_FORMAT |
Wrong file type. |
PARSE_ERROR |
Error parsing input (or input file) |
IO_ERROR |
An I/O error occured (e.g. read from file failed.) |
INVALID_MESH |
The mesh is invalid. |
NO_PD_STORAGE_MODE |
no storage mode chosen within PatchData |
NOT_IMPLEMENTED |
requested functionality is not (yet) implemented |
INTERNAL_ERROR |
A bug in Mesquite. |
INTERRUPTED |
Application or user interrupted operation. |
TAG_ALREADY_EXISTS |
Attempt to create tag that already exists. |
TAG_NOT_FOUND |
Specified tag does not exist. |
LAST_ERROR_CODE | |
NO_ERROR |
no error |
UNKNOWN_ERROR |
unknown error occured |
OUT_OF_MEMORY |
unable to allocate the necessary memory |
INVALID_ARG |
invalid function argument passed |
NOT_INITIALIZED |
object not initialized |
INVALID_STATE |
object is in an invalid state |
FILE_ACCESS |
File cannot be opened/created. |
FILE_FORMAT |
Wrong file type. |
PARSE_ERROR |
Error parsing input (or input file) |
IO_ERROR |
An I/O error occured (e.g. read from file failed.) |
INVALID_MESH |
The mesh is invalid. |
NO_PD_STORAGE_MODE |
no storage mode chosen within PatchData |
NOT_IMPLEMENTED |
requested functionality is not (yet) implemented |
INTERNAL_ERROR |
A bug in Mesquite. |
INTERRUPTED |
Application or user interrupted operation. |
TAG_ALREADY_EXISTS |
Attempt to create tag that already exists. |
TAG_NOT_FOUND |
Specified tag does not exist. |
LAST_ERROR_CODE |
Definition at line 115 of file includeLinks/MsqError.hpp.
enum ErrorCode |
Error codes.
Enumerator | |
---|---|
NO_ERROR |
no error |
UNKNOWN_ERROR |
unknown error occured |
OUT_OF_MEMORY |
unable to allocate the necessary memory |
INVALID_ARG |
invalid function argument passed |
NOT_INITIALIZED |
object not initialized |
INVALID_STATE |
object is in an invalid state |
FILE_ACCESS |
File cannot be opened/created. |
FILE_FORMAT |
Wrong file type. |
PARSE_ERROR |
Error parsing input (or input file) |
IO_ERROR |
An I/O error occured (e.g. read from file failed.) |
INVALID_MESH |
The mesh is invalid. |
NO_PD_STORAGE_MODE |
no storage mode chosen within PatchData |
NOT_IMPLEMENTED |
requested functionality is not (yet) implemented |
INTERNAL_ERROR |
A bug in Mesquite. |
INTERRUPTED |
Application or user interrupted operation. |
TAG_ALREADY_EXISTS |
Attempt to create tag that already exists. |
TAG_NOT_FOUND |
Specified tag does not exist. |
LAST_ERROR_CODE | |
NO_ERROR |
no error |
UNKNOWN_ERROR |
unknown error occured |
OUT_OF_MEMORY |
unable to allocate the necessary memory |
INVALID_ARG |
invalid function argument passed |
NOT_INITIALIZED |
object not initialized |
INVALID_STATE |
object is in an invalid state |
FILE_ACCESS |
File cannot be opened/created. |
FILE_FORMAT |
Wrong file type. |
PARSE_ERROR |
Error parsing input (or input file) |
IO_ERROR |
An I/O error occured (e.g. read from file failed.) |
INVALID_MESH |
The mesh is invalid. |
NO_PD_STORAGE_MODE |
no storage mode chosen within PatchData |
NOT_IMPLEMENTED |
requested functionality is not (yet) implemented |
INTERNAL_ERROR |
A bug in Mesquite. |
INTERRUPTED |
Application or user interrupted operation. |
TAG_ALREADY_EXISTS |
Attempt to create tag that already exists. |
TAG_NOT_FOUND |
Specified tag does not exist. |
LAST_ERROR_CODE |
Definition at line 115 of file src/Misc/MsqError.hpp.
|
inline |
|
virtual |
Destructor - empty but must declar virtual destrucor if virtual functions.
Definition at line 82 of file Misc/MsqError.cpp.
|
inline |
|
virtual |
Destructor - empty but must declar virtual destrucor if virtual functions.
void clear | ( | ) |
resets error object to non-active state (no error).
Definition at line 150 of file Misc/MsqError.cpp.
References MsqError::errorCode, MsqError::errorMessage, MsqError::NO_ERROR, and MsqError::stackTrace.
Referenced by ParameterSet::generic_add_parameter(), and MeshImpl::read_vtk().
void clear | ( | ) |
resets error object to non-active state (no error).
|
inline |
Check if an error has occured.
Definition at line 140 of file includeLinks/MsqError.hpp.
References MsqError::errorCode, and MsqError::NO_ERROR.
Referenced by MsqPrintError::~MsqPrintError().
|
inline |
Check if an error has occured.
Definition at line 140 of file src/Misc/MsqError.hpp.
References MsqError::errorCode, and MsqError::NO_ERROR.
|
inline |
Get error code.
Definition at line 155 of file includeLinks/MsqError.hpp.
References MsqError::errorCode.
Referenced by Mesquite::operator<<().
|
inline |
Get error code.
Definition at line 155 of file src/Misc/MsqError.hpp.
References MsqError::errorCode.
const char * error_message | ( | ) | const |
Get error message.
Definition at line 45 of file Misc/MsqError.cpp.
References MsqError::errorCode, MsqError::errorMessage, and MsqError::LAST_ERROR_CODE.
Referenced by Mesquite::operator<<().
const char* error_message | ( | ) | const |
Get error message.
|
inline |
Check if an error has occured.
Definition at line 142 of file src/Misc/MsqError.hpp.
References MsqError::errorCode, and MsqError::NO_ERROR.
|
inline |
Check if an error has occured.
Definition at line 142 of file includeLinks/MsqError.hpp.
References MsqError::errorCode, and MsqError::NO_ERROR.
|
virtual |
Add to back-trace of call stack.
Called by MSQ_CHKERR. Must always return true.
|
virtual |
Add to back-trace of call stack.
Called by MSQ_CHKERR. Must always return true.
Definition at line 130 of file Misc/MsqError.cpp.
References MsqError::stackTrace.
Referenced by MsqError::Setter::set().
|
virtual |
Initialize the error object with the passed data.
Definition at line 136 of file Misc/MsqError.cpp.
References MsqError::errorCode, MsqError::errorMessage, MsqError::NO_ERROR, and MsqError::stackTrace.
Referenced by MsqError::Setter::set().
|
virtual |
Initialize the error object with the passed data.
|
inlinestatic |
Definition at line 213 of file includeLinks/MsqError.hpp.
|
inlinestatic |
Definition at line 213 of file src/Misc/MsqError.hpp.
|
inline |
Get stack trace.
Definition at line 176 of file includeLinks/MsqError.hpp.
References MsqError::stackTrace.
Referenced by Mesquite::operator<<().
|
inline |
Get stack trace.
Definition at line 176 of file src/Misc/MsqError.hpp.
References MsqError::stackTrace.
|
private |
Definition at line 218 of file includeLinks/MsqError.hpp.
Referenced by MsqError::clear(), MsqError::error(), MsqError::error_code(), MsqError::error_message(), MsqError::operator bool(), and MsqError::set_error().
|
private |
Definition at line 219 of file includeLinks/MsqError.hpp.
Referenced by MsqError::clear(), MsqError::error_message(), and MsqError::set_error().
|
private |
Definition at line 220 of file includeLinks/MsqError.hpp.
Referenced by MsqError::clear(), MsqError::push(), MsqError::set_error(), and MsqError::stack().