From a29eee4e73ba2eb13b147027302435552f465b07 Mon Sep 17 00:00:00 2001 From: Senthil Ramakrishnan Date: Mon, 2 Jul 2018 15:42:58 -0500 Subject: [PATCH] Don't print error reports in release builds --- platform/mbed_error.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/mbed_error.c b/platform/mbed_error.c index 269eebd48b5..dc9f6126063 100644 --- a/platform/mbed_error.c +++ b/platform/mbed_error.c @@ -78,7 +78,9 @@ WEAK void error(const char *format, ...) //Call handle_error/print_error_report permanently setting error_in_progress flag handle_error(MBED_ERROR_UNKNOWN, 0, NULL, 0); +#ifndef NDEBUG print_error_report(&last_error_ctx, "Fatal Run-time error"); +#endif error_in_progress = 1; #ifndef NDEBUG @@ -199,8 +201,10 @@ WEAK mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char return MBED_ERROR_FAILED_OPERATION; } +#ifndef NDEBUG //On fatal errors print the error context/report print_error_report(&last_error_ctx, error_msg); +#endif mbed_halt_system(); return MBED_ERROR_FAILED_OPERATION;