ATLAS Offline Software
Macros
CheckExc.h File Reference
#include <ostream>
#include <stdexcept>
Include dependency graph for CheckExc.h:

Go to the source code of this file.

Macros

#define CHECK_EXC(ARG)
 Checks the result of a call, and if it is false, or StatusCode::FAILURE, raise an exception. More...
 

Macro Definition Documentation

◆ CHECK_EXC

#define CHECK_EXC (   ARG)
Value:
do { \
const bool result = static_cast<bool>(ARG); \
if (!result) { \
std::ostringstream os; \
os << "Failed to execute: \"" << #ARG << "\""; \
throw std::runtime_error(os.str()); \
} \
} while (false)

Checks the result of a call, and if it is false, or StatusCode::FAILURE, raise an exception.

Use this for cases where you don't have code to recover from a failure, or where you don't expect the command to fail under normal circumstances.

Definition at line 17 of file CheckExc.h.

get_generator_info.result
result
Definition: get_generator_info.py:21
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231