Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DQMServices
Core
src
DQMError.cc
Go to the documentation of this file.
1
#include "
DQMServices/Core/src/DQMError.h
"
2
#include <stdarg.h>
3
#include <stdio.h>
4
#include <stdlib.h>
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
= 0;
15
16
va_start(args, fmt);
17
vasprintf(&message, fmt, args);
18
va_end(args);
19
20
#if WITHOUT_CMS_FRAMEWORK
21
char
*
final
= 0;
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
}
fmt
static const char * fmt
Definition:
Version.cc:9
dqmdata_cleaner.args
tuple args
Definition:
dqmdata_cleaner.py:247
DQMError.h
cms::Exception
Definition:
Exception.h:68
python.rootplot.argparse.message
string 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.5