Skip to content

Commit 28bae78

Browse files
authored
fix: show error message for ensure (#626)
Signed-off-by: Alex Chi <[email protected]>
1 parent 44eea30 commit 28bae78

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/include/common/macros.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ namespace bustub {
2222

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

25-
#define BUSTUB_ENSURE(expr, message) \
26-
if (!(expr)) { \
27-
std::terminate(); \
25+
#define BUSTUB_ENSURE(expr, message) \
26+
if (!(expr)) { \
27+
std::cerr << "ERROR: " << (message) << std::endl; \
28+
std::terminate(); \
2829
}
2930

3031
#define UNREACHABLE(message) throw std::logic_error(message)

0 commit comments

Comments
 (0)