Main Page
Namespaces
Classes
Package Documentation
DQMServices
Core
src
DQMError.cc
Go to the documentation of this file.
1
#include "
DQMServices/Core/src/DQMError.h
"
2
#include <cstdarg>
3
#include <cstdio>
4
#include <cstdlib>
5
6
#if WITHOUT_CMS_FRAMEWORK
7
static
const
char
FAILED[] =
"(out of memory while formatting error message)"
;
8
#endif
9
10
void
11
raiseDQMError
(
const
char
*context,
const
char
*fmt, ...)
12
{
13
va_list
args
;
14
char
*
message
=
nullptr
;
15
16
va_start(args, fmt);
17
vasprintf(&message, fmt, args);
18
va_end(args);
19
20
#if WITHOUT_CMS_FRAMEWORK
21
char
*
final
=
nullptr
;
22
asprintf(&
final
,
"%s: %s"
, context, message ? message : FAILED);
23
std::runtime_error err(
final
?
final
: FAILED);
24
free(
final
);
25
#else
26
cms::Exception
err(context);
27
if
(message)
28
err <<
message
;
29
#endif
30
31
free(message);
32
throw
err;
33
}
DQMError.h
createfilelist.args
args
Definition:
createfilelist.py:13
cms::Exception
Definition:
Exception.h:67
python.rootplot.argparse.message
message
Definition:
argparse.py:130
raiseDQMError
void raiseDQMError(const char *context, const char *fmt,...)
Definition:
DQMError.cc:11
Generated for CMSSW Reference Manual by
1.8.11