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
raiseDQMError
(
const
char
*context,
const
char
*fmt, ...) {
11
va_list
args
;
12
char
*message =
nullptr
;
13
14
va_start(args, fmt);
15
vasprintf(&message, fmt, args);
16
va_end(args);
17
18
#if WITHOUT_CMS_FRAMEWORK
19
char
*
final
=
nullptr
;
20
asprintf(&
final
,
"%s: %s"
, context, message ? message : FAILED);
21
std::runtime_error
err
(
final
?
final
: FAILED);
22
free(
final
);
23
#else
24
cms::Exception
err
(context);
25
if
(message)
26
err << message;
27
#endif
28
29
free(message);
30
throw
err
;
31
}
runTheMatrix.err
err
Definition:
runTheMatrix.py:281
DQMError.h
cms::Exception
Definition:
Exception.h:68
writedatasetfile.args
args
Definition:
writedatasetfile.py:18
raiseDQMError
void raiseDQMError(const char *context, const char *fmt,...)
Definition:
DQMError.cc:10
Generated for CMSSW Reference Manual by
1.8.11