39 va_start(arglist, msg);
40 vsprintf(text, msg, arglist);
43 strcpy(message, text);
49 printf(
"Exception: %s\n", message);
51 printf(
"Default exception\n");
63 char* messageWithReturn =
new char[strlen(message)+2];
64 strcpy(messageWithReturn, message);
65 sprintf(messageWithReturn + strlen(message),
"\n");
66 return messageWithReturn;
71 this->param_idx = param_idx;
73 char * msg =
new char[27];
74 sprintf(msg,
"Parameter number %d is NULL", param_idx);
80 this->param_idx = param_idx;
81 this->item_idx = item_idx;
82 char * msg =
new char[55];
83 sprintf(msg,
"Element number %d of parameter number %d is NULL", item_idx, param_idx);
99 char * msg =
new char[strlen(e.
what())+1];
100 strcpy(msg, e.
what());
106 Exception* NullException::clone()
113 fst_param_idx = param_idx;
116 this->snd_param_idx = -1;
117 char * msg =
new char[60];
118 sprintf(msg,
"Parameter number %d have length %d and should have %d", fst_param_idx, wrong, right);
124 this->fst_param_idx = fst_param_idx;
125 this->snd_param_idx = snd_param_idx;
127 this->right = second;
128 char * msg =
new char[110];
129 sprintf(msg,
"Parameter number %d have length %d and parameter number %d have length %d. The lengths should be same",
130 fst_param_idx, wrong, snd_param_idx, right);
136 return fst_param_idx;
141 return snd_param_idx;
156 char * msg =
new char[strlen(e.
what())+1];
157 strcpy(msg, e.
what());
165 Exception* LengthException::clone()
172 char * msg =
new char[22];
173 sprintf(msg,
"Linear solver failed.");
179 char * msg =
new char[34 + strlen(reason)];
180 sprintf(msg,
"Linear solver failed because:\"%s\"", reason);
186 char * msg =
new char[strlen(e.
what())+1];
187 strcpy(msg, e.
what());
191 Exception* LinearMatrixSolverException::clone()
198 char * msg =
new char[55 + strlen(name)];
200 sprintf(msg,
"Variable %s is %f but maximum allowed value is %f", name, value, allowed);
202 sprintf(msg,
"Variable %s is %f but minimum allowed value is %f", name, value, allowed);
205 this->allowed = allowed;
210 char * msg =
new char[70+strlen(name)];
211 sprintf(msg,
"Variable %s is %f allowed range is %f -- %f", name, value, min, max);
222 char * msg =
new char[70+strlen(name)];
223 sprintf(msg,
"Variable %s does not support value %s.", name, passed.c_str());
239 char * msg =
new char[strlen(e.
what())+1];
240 strcpy(msg, e.
what());
246 Exception* ValueException::clone()
253 char* text =
new char[1024];
254 sprintf(text,
"Method not overriden: ");
258 va_start(arglist, name);
259 vsprintf(text = text + strlen(
"Method not overriden: "), name, arglist);
261 message = text - strlen(
"Method not overriden: ");
266 char * msg =
new char[strlen(e.
what())+1];
267 strcpy(msg, e.
what());
271 Exception* MethodNotOverridenException::clone()
278 char * text =
new char[strlen(reason)+1];
282 va_start(arglist, reason);
283 vsprintf(text, reason, arglist);
291 char * msg =
new char[strlen(e.
what())+1];
292 strcpy(msg, e.
what());
296 Exception* MeshLoadFailureException::clone()
303 char * text =
new char[strlen(reason)+1];
307 va_start(arglist, reason);
308 vsprintf(text, reason, arglist);
316 char * msg =
new char[strlen(e.
what())+1];
317 strcpy(msg, e.
what());
321 Exception* SpaceLoadFailureException::clone()
328 char * text =
new char[strlen(reason)+1];
332 va_start(arglist, reason);
333 vsprintf(text, reason, arglist);
341 char * msg =
new char[strlen(e.
what())+1];
342 strcpy(msg, e.
what());
346 Exception* SolutionSaveFailureException::clone()
353 char * text =
new char[strlen(reason)+1];
357 va_start(arglist, reason);
358 vsprintf(text, reason, arglist);
366 char * msg =
new char[strlen(e.
what())+1];
367 strcpy(msg, e.
what());
371 Exception* SolutionLoadFailureException::clone()