1 |
|
|
/** |
2 |
|
|
* @file exception-feature.cpp |
3 |
|
|
* @author Maximilien Naveau (maximilien.naveau@gmail.com) |
4 |
|
|
* @license License BSD-3-Clause |
5 |
|
|
* @copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft. |
6 |
|
|
* @date 2019-05-22 |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
#include <dynamic_graph_manager/exception/exception-feature.hh> |
10 |
|
|
#include <stdarg.h> |
11 |
|
|
#include <cstdio> |
12 |
|
|
|
13 |
|
|
using namespace dynamic_graph; |
14 |
|
|
|
15 |
|
|
/* --------------------------------------------------------------------- */ |
16 |
|
|
/* --- CLASS ----------------------------------------------------------- */ |
17 |
|
|
/* --------------------------------------------------------------------- */ |
18 |
|
|
|
19 |
✓✗ |
4 |
const std::string ExceptionFeature::EXCEPTION_NAME = "Feature"; |
20 |
|
|
|
21 |
|
|
ExceptionFeature:: |
22 |
|
|
ExceptionFeature ( const ExceptionFeature::ErrorCodeEnum& errcode, |
23 |
|
|
const std::string & msg ) |
24 |
|
|
:ExceptionAbstract(errcode,msg) |
25 |
|
|
{ |
26 |
|
|
} |
27 |
|
|
|
28 |
|
|
ExceptionFeature:: |
29 |
|
|
ExceptionFeature ( const ExceptionFeature::ErrorCodeEnum& errcode, |
30 |
|
|
const std::string & msg,const char* format, ... ) |
31 |
|
|
:ExceptionAbstract(errcode,msg) |
32 |
|
|
{ |
33 |
|
|
va_list args; |
34 |
|
|
va_start(args,format); |
35 |
|
|
|
36 |
|
|
const unsigned int SIZE = 256; |
37 |
|
|
char buffer[SIZE]; |
38 |
|
|
vsnprintf(buffer,SIZE,format,args); |
39 |
|
|
|
40 |
|
|
message = buffer; |
41 |
|
|
|
42 |
|
|
va_end(args); |
43 |
✓✗✓✗
|
12 |
} |
44 |
|
|
|
45 |
|
|
|
46 |
|
|
/* |
47 |
|
|
* Local variables: |
48 |
|
|
* c-basic-offset: 2 |
49 |
|
|
* End: |
50 |
|
|
*/ |