https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 731fd846b52430e889fb5fdae2d82ff2cd269681 authored by Lars Bilke on 24 February 2021, 13:41:48 UTC
[ci] Added manual job "linux ctest large".
Tip revision: 731fd84
Error.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#pragma once

#include <cstdlib>
#include "Logging.h"

#ifdef OGS_FATAL_ABORT
#define OGS_FATAL(...)                                                      \
    {                                                                       \
        BaseLib::console->critical("{}:{} {}() ", __FILE__, __LINE__,       \
                                   __FUNCTION__, fmt::format(__VA_ARGS__)); \
        std::abort();                                                       \
    }
#else  // OGS_FATAL_ABORT
#include <stdexcept>
#define OGS_FATAL(...)                                                      \
    {                                                                       \
        BaseLib::console->critical("{}:{} {}() ", __FILE__, __LINE__,       \
                                   __FUNCTION__, fmt::format(__VA_ARGS__)); \
        throw std::runtime_error(fmt::format(__VA_ARGS__));                 \
    }
#endif  // OGS_FATAL_ABORT

back to top