41 va_start(arglist, msg);
42 vsprintf(text, msg, arglist);
45 this->message << text;
50 this->message << e.message.str();
55 std::cout <<
"Exception: " << message.str() << std::endl;
60 sprintf(const_cast<char*>(this->
message_char),
"%s", this->message.str().c_str());
64 std::string Exception::info()
const
66 return this->message.str();
73 this->filename = ss.str();
82 this->readWrite = e.readWrite;
83 this->filename = e.filename;
88 this->message <<
"A pointer is invalid (nullptr)";
93 this->param_idx = param_idx;
95 this->message.clear();
96 this->message <<
"Parameter number " << param_idx <<
" is nullptr";
101 this->param_idx = param_idx;
102 this->item_idx = item_idx;
103 this->message.clear();
104 this->message <<
"Element number " << item_idx <<
" of parameter number " << param_idx <<
" is nullptr";
119 this->message.clear();
120 this->message << e.message.str();
127 this->message.clear();
128 this->message <<
"Two instances do not have the same length and they should";
135 this->message.clear();
136 this->message <<
"An instance has length " << wrong <<
" and should have " << right;
141 fst_param_idx = param_idx;
144 this->snd_param_idx = -1;
145 this->message.clear();
146 this->message <<
"Parameter number " << fst_param_idx <<
" have length " << wrong <<
" and should have " << right;
151 this->fst_param_idx = fst_param_idx;
152 this->snd_param_idx = snd_param_idx;
154 this->right = second;
155 this->message.clear();
156 this->message <<
"Parameter number " << fst_param_idx <<
" have length " << wrong <<
" and parameter number " << snd_param_idx <<
" have length " << right <<
" The lengths should be same.";
161 return fst_param_idx;
166 return snd_param_idx;
181 this->message << e.message.str();
190 this->message <<
"Linear solver failed.";
199 va_start(arglist, reason);
200 vsprintf(text, reason, arglist);
203 this->message <<
"Linear solver failed because: " << text;
208 this->message << e.message.str();
214 this->message <<
"Variable " << name <<
" is " << value <<
" but maximum allowed value is " << allowed;
216 this->message <<
"Variable " << name <<
" is " << value <<
" but minimum allowed value is " << allowed;
218 this->allowed = allowed;
223 this->message <<
"Variable " << name <<
" is " << value <<
" allowed range is " << min <<
" -- " << max;
233 this->message <<
"Variable " << name <<
" does not support value " << passed;
248 this->message << e.message.str();
259 va_start(arglist, name);
260 vsprintf(text, name, arglist);
263 this->message <<
"Method not overriden: " << text;
268 this->message << e.message.str();
277 va_start(arglist, name);
278 vsprintf(text, name, arglist);
281 this->message <<
"Sorry, method not implemented so far: " << text;
286 this->message << e.message.str();
295 va_start(arglist, reason);
296 vsprintf(text, reason, arglist);
299 this->message <<
"Mesh loading failed: " << (std::string)text;
304 this->message << e.message.str();
313 va_start(arglist, reason);
314 vsprintf(text, reason, arglist);
317 this->message <<
"Space loading failed: " << text;
322 this->message << e.message.str();
331 va_start(arglist, reason);
332 vsprintf(text, reason, arglist);
335 this->message <<
"Solution saving failed: " << text;
340 this->message << e.message.str();
349 va_start(arglist, reason);
350 vsprintf(text, reason, arglist);
353 this->message <<
"Solution loading failed: " << text;
358 this->message << e.message.str();
IOException(ReadWrite readWrite, const char *filename)
SolutionSaveFailureException(const char *msg,...)
General namespace for the Hermes library.
LengthException()
Two parameters do not have equal length.
Exception interface Basically a std::exception, but with a constructor with string and with print_msg...
MethodNotImplementedException(const char *msg,...)
Parameter length parameter exception. Internal. Exception occurs when some parameter has wrong length...
char message_char[10000]
To be compatible with what().
File containing common definitions, and basic global enums etc. for HermesCommon. ...
MeshLoadFailureException(const char *msg,...)
unsigned int get_second_param_idx() const
unsigned int get_first_length() const
NullException()
Constructor - simple.
Mesh failed to load. Thrown by Hermes2D::MeshReaderH2DXML, MeshReaderH2D.
unsigned int get_param_idx() const
virtual const char * what() const
get pointer to error message
unsigned int get_first_param_idx() const
double get_allowed() const
return allowed value of variable.
File containing functionality for investigating call stack.
File containing definition of exceptions classes.
unsigned int get_item_idx() const
void print_msg() const
print error message to stderr
LinearMatrixSolverException()
Linear solver failed from unknown reason.
unsigned int get_expected_length() const
Exception()
Init exception with default message.
Mix-in classes for one functionality, for various classes to be derived from.
Null parameter exception. Internal. Exception occurs when some parameter is Null or empty and it shou...
Method is not overriden and should be.
MethodNotOverridenException(const char *msg,...)
Numeric value is out of allowed range.
SolutionLoadFailureException(const char *msg,...)
ValueException(const char *name, double value, double allowed)
SpaceLoadFailureException(const char *msg,...)
Method is not overriden and should be.