43 #define M_ERROR_STRING_LEN 512
54 laError() { _strText[0] =
'\0'; }
61 char* getText() {
return _strText; }
66 class laError_Assert:
public laError
70 laError_Assert(
char* strFunction,
char* strFile,
int nLine,
71 char* strFormat, ...);
80 #define ASSERT(condition, str_why, ...) if( !(condition) ) throw laError_Assert(__FUNCTION__, __FILE__, __LINE__, (str_why), __VA_ARGS__)
81 #define ERRORLEVEL_BEGIN int _narg_=0; try{
82 #define ERRORLEVEL_END } \
83 catch(laError& err) { throw laError("-->> in %s(%d): \n%s", __FUNCTION__, _narg_, err.getText()); } \
84 catch(...) { throw laError("-->> (unknown error) in %s(%d)", __FUNCTION__, _narg_); }
85 #define ERRORLEVEL_ARG(val) _narg_ = (val)
86 #define ERRORLEVEL_ARGVAL _narg_
88 #define ASSERT(condition, str_why, ...)
89 #define ERRORLEVEL_BEGIN
90 #define ERRORLEVEL_END
91 #define ERRORLEVEL_ARG(val)
92 #define ERRORLEVEL_ARGVAL 0
97 class laError_Calc:
public laError
100 laError_Calc():
laError(
"Calculational Error") {};
103 class laError_PropertyNotDefined:
public laError
106 laError_PropertyNotDefined(std::string name):
laError(
"Property '%s' not defined.", name.c_str()) {};
#define M_ERROR_STRING_LEN