Skip to content

Commit

Permalink
Fix: Correct error handling to properly terminate process on fatal ex…
Browse files Browse the repository at this point in the history
…ceptions
  • Loading branch information
umegane committed Nov 20, 2024
1 parent 3398b45 commit 155fb6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/limestone/limestone_exception_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ inline void handle_exception_and_abort(std::string_view func_name) {
if (limestone::testing::enable_exception_throwing) {
throw;
}
VLOG_LP(google::FATAL) << "Fatal error in " << func_name << ": " << e.what();
LOG_LP(FATAL) << "Fatal error in " << func_name << ": " << e.what();
std::abort(); // Safety measure: this should never be reached due to VLOG_LP(google::FATAL)
} catch (const std::runtime_error& e) {
VLOG_LP(google::FATAL) << "Runtime error in " << func_name << ": " << e.what();
LOG_LP(FATAL) << "Runtime error in " << func_name << ": " << e.what();
std::abort(); // Safety measure: this should never be reached due to VLOG_LP(google::FATAL)
} catch (const std::exception& e) {
VLOG_LP(google::FATAL) << "Unexpected exception in " << func_name << ": " << e.what();
LOG_LP(FATAL) << "Unexpected exception in " << func_name << ": " << e.what();
std::abort(); // Safety measure: this should never be reached due to VLOG_LP(google::FATAL)
} catch (...) {
VLOG_LP(google::FATAL) << "Unknown exception in " << func_name;
LOG_LP(FATAL) << "Unknown exception in " << func_name;
std::abort(); // Safety measure: this should never be reached due to VLOG_LP(google::FATAL)
}
}
Expand Down

0 comments on commit 155fb6d

Please sign in to comment.