#include <opm/common/Exceptions.hpp> #include <opm/simulators/utils/DeferredLogger.hpp> #include <opm/simulators/utils/gatherDeferredLogger.hpp> #include <opm/simulators/utils/ParallelCommunication.hpp> #include <string> #include <exception> #include <stdexcept>
Include dependency graph for DeferredLoggingErrorHelpers.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Macro Definition Documentation◆ OPM_BEGIN_PARALLEL_TRY_CATCH
Value:
Macro to setup the try of a parallel try-catch. Use OPM_END_PARALLEL_TRY_CATCH or OPM_END_PARALLEL_TRY_CATCH_LOG fot the catch part. ◆ OPM_DEFLOG_PROBLEM
Value:
do { \
std::to_string(__LINE__) + "] " + \
message; \
deferred_logger.problem(oss_); \
throw Exception(oss_); \
} while (false)
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t) ◆ OPM_DEFLOG_THROW
Value:
do { \
std::to_string(__LINE__) + "] " + \
message; \
deferred_logger.error(oss_); \
throw Exception(oss_); \
} while (false)
◆ OPM_END_PARALLEL_TRY_CATCH
Value:
} \
OPM_PARALLEL_CATCH_CLAUSE(obptc_exc_type, obptc_exc_msg);\
checkForExceptionsAndThrow(obptc_exc_type, \
prefix + obptc_exc_msg, comm);
Catch exception and throw in a parallel try-catch clause. Assumes that OPM_BEGIN_PARALLEL_TRY_CATCH() was called to initiate the try-catch clause ◆ OPM_END_PARALLEL_TRY_CATCH_LOG
Value:
} \
OPM_PARALLEL_CATCH_CLAUSE(obptc_exc_type, obptc_exc_msg); \
logAndCheckForExceptionsAndThrow(obptc_logger, obptc_exc_type, \
obptc_prefix + obptc_exc_msg, obptc_output, comm);
Catch exception, log, and throw in a parallel try-catch clause. Assumes that OPM_BEGIN_PARALLEL_TRY_CATCH() was called to initiate the try-catch clause ◆ OPM_PARALLEL_CATCH_CLAUSE
Value:
catch (const Opm::NumericalProblem& e){ \
obptc_exc_type = Opm::ExceptionType::NUMERICAL_ISSUE; \
obptc_exc_msg = e.what(); \
} catch (const std::runtime_error& e) { \
obptc_exc_type = Opm::ExceptionType::RUNTIME_ERROR; \
obptc_exc_msg = e.what(); \
} catch (const std::invalid_argument& e) { \
obptc_exc_type = Opm::ExceptionType::INVALID_ARGUMENT; \
obptc_exc_msg = e.what(); \
} catch (const std::logic_error& e) { \
obptc_exc_type = Opm::ExceptionType::LOGIC_ERROR; \
obptc_exc_msg = e.what(); \
} catch (const std::exception& e) { \
obptc_exc_type = Opm::ExceptionType::DEFAULT; \
obptc_exc_msg = e.what(); \
} catch (...) { \
obptc_exc_type = Opm::ExceptionType::DEFAULT; \
obptc_exc_msg = "Unknown exception was thrown"; \
}
Inserts catch classes for the parallel try-catch. There is a clause that will catch anything Function Documentation◆ checkForExceptionsAndThrow()
◆ logAndCheckForExceptionsAndThrow()
◆ logAndCheckForProblemsAndThrow()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||