Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Copyright 2010, |
3 |
|
|
* François Bleibel, |
4 |
|
|
* Olivier Stasse, |
5 |
|
|
* |
6 |
|
|
* CNRS/AIST |
7 |
|
|
* |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#include <stdarg.h> |
11 |
|
|
|
12 |
|
|
#include <cstdio> |
13 |
|
|
#include <sot/core/exception-task.hh> |
14 |
|
|
|
15 |
|
|
using namespace dynamicgraph::sot; |
16 |
|
|
|
17 |
|
|
/* --------------------------------------------------------------------- */ |
18 |
|
|
/* --- CLASS ----------------------------------------------------------- */ |
19 |
|
|
/* --------------------------------------------------------------------- */ |
20 |
|
|
|
21 |
|
|
const std::string ExceptionTask::EXCEPTION_NAME = "Task"; |
22 |
|
|
|
23 |
|
✗ |
ExceptionTask::ExceptionTask(const ExceptionTask::ErrorCodeEnum &errcode, |
24 |
|
✗ |
const std::string &msg) |
25 |
|
✗ |
: ExceptionAbstract(errcode, msg) {} |
26 |
|
|
|
27 |
|
✗ |
ExceptionTask::ExceptionTask(const ExceptionTask::ErrorCodeEnum &errcode, |
28 |
|
✗ |
const std::string &msg, const char *format, ...) |
29 |
|
✗ |
: ExceptionAbstract(errcode, msg) { |
30 |
|
|
va_list args; |
31 |
|
✗ |
va_start(args, format); |
32 |
|
|
|
33 |
|
✗ |
const unsigned int SIZE = 256; |
34 |
|
|
char buffer[SIZE]; |
35 |
|
✗ |
vsnprintf(buffer, SIZE, format, args); |
36 |
|
|
|
37 |
|
✗ |
message = buffer; |
38 |
|
|
|
39 |
|
✗ |
va_end(args); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
/* |
43 |
|
|
* Local variables: |
44 |
|
|
* c-basic-offset: 2 |
45 |
|
|
* End: |
46 |
|
|
*/ |
47 |
|
|
|