Skip to content

Commit a29eee4

Browse files
committed
Don't print error reports in release builds
1 parent 93233c4 commit a29eee4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

platform/mbed_error.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ WEAK void error(const char *format, ...)
7878

7979
//Call handle_error/print_error_report permanently setting error_in_progress flag
8080
handle_error(MBED_ERROR_UNKNOWN, 0, NULL, 0);
81+
#ifndef NDEBUG
8182
print_error_report(&last_error_ctx, "Fatal Run-time error");
83+
#endif
8284
error_in_progress = 1;
8385

8486
#ifndef NDEBUG
@@ -199,8 +201,10 @@ WEAK mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char
199201
return MBED_ERROR_FAILED_OPERATION;
200202
}
201203

204+
#ifndef NDEBUG
202205
//On fatal errors print the error context/report
203206
print_error_report(&last_error_ctx, error_msg);
207+
#endif
204208
mbed_halt_system();
205209

206210
return MBED_ERROR_FAILED_OPERATION;

0 commit comments

Comments
 (0)