9#ifndef DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_ERRORS_UTILS_ERRORHANDLING_HPP
10#define DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_ERRORS_UTILS_ERRORHANDLING_HPP
29 template<ErrorSeverity Severity = ErrorSeverity::Warning>
32 std::stringstream errorMessage;
35 errorMessage <<
"\n " << error.
message;
37 errorMessage <<
' ' << error.
message;
41 std::cerr << error.
programName <<
" Fatal Error:" << errorMessage.str() << std::endl;
42 std::exit(EXIT_FAILURE);
45 std::cerr << error.
programName <<
" Warning:" << errorMessage.str() << std::endl;
Definition fatalException.hpp:20
auto printFatalErrorMessage
A convenience function for printing an error message when said error is fatal.
Definition errorHandling.hpp:49
void printErrorMessage(const ErrorMessage &error)
Definition errorHandling.hpp:30
constexpr bool is_fatal_v
Convenience variable template for ease-of-use.
Definition isFatal.hpp:40
Definition errorTypes.hpp:32
std::size_t lineNumber
The line number where the error took place, use the LINE macro.
Definition errorTypes.hpp:36
std::string programName
The name of the program where the exception originated.
Definition errorTypes.hpp:33
std::string fileName
The file name where the error took place, use the FILE macro.
Definition errorTypes.hpp:35
std::string message
The main error message describing the error.
Definition errorTypes.hpp:34