OGS
Error.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <stdexcept>
7
8#include "Logging.h"
9
10#define OGS_FATAL(...) \
11 { \
12 auto const formatted_va_args = fmt::format(__VA_ARGS__); \
13 BaseLib::console->critical("{}:{} {}() {}", __FILE__, __LINE__, \
14 __FUNCTION__, formatted_va_args); \
15 BaseLib::console->flush(); \
16 throw std::runtime_error(formatted_va_args); \
17 }