Skip to content

Commit

Permalink
fix: show error message for ensure (#626)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh authored Oct 17, 2023
1 parent 44eea30 commit 28bae78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/include/common/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ namespace bustub {

#define UNIMPLEMENTED(message) throw std::logic_error(message)

#define BUSTUB_ENSURE(expr, message) \
if (!(expr)) { \
std::terminate(); \
#define BUSTUB_ENSURE(expr, message) \
if (!(expr)) { \
std::cerr << "ERROR: " << (message) << std::endl; \
std::terminate(); \
}

#define UNREACHABLE(message) throw std::logic_error(message)
Expand Down

0 comments on commit 28bae78

Please sign in to comment.