Skip to content

Commit 930ff2b

Browse files
marcaubereraengelke
authored andcommitted
[TPDE] Throw runtime_error on fatal_error if eh is enabled
1 parent c783666 commit 930ff2b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tpde/src/base.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
#include "tpde/base.hpp"
55

66
#include <cstdlib>
7+
#include <stdexcept>
78

89
namespace tpde {
910

1011
[[noreturn]] void fatal_error([[maybe_unused]] const char *msg) {
1112
TPDE_LOG_ERR("TPDE FATAL ERROR: {}", msg);
13+
#ifdef __cpp_exceptions
14+
throw std::runtime_error(msg);
15+
#else
1216
abort();
17+
#endif
1318
}
1419

1520
} // end namespace tpde

0 commit comments

Comments
 (0)