OGS
Error.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <cstdlib>
14 #include "Logging.h"
15 
16 #ifdef OGS_FATAL_ABORT
17 #define OGS_FATAL(...) \
18  { \
19  BaseLib::console->critical("{}:{} {}() ", __FILE__, __LINE__, \
20  __FUNCTION__, fmt::format(__VA_ARGS__)); \
21  std::abort(); \
22  }
23 #else // OGS_FATAL_ABORT
24 #include <stdexcept>
25 #define OGS_FATAL(...) \
26  { \
27  BaseLib::console->critical("{}:{} {}() ", __FILE__, __LINE__, \
28  __FUNCTION__, fmt::format(__VA_ARGS__)); \
29  throw std::runtime_error(fmt::format(__VA_ARGS__)); \
30  }
31 #endif // OGS_FATAL_ABORT
32 
Logging.h