From 0bafc0b65e5cfc8dbf3ad079b60895d78ff5545c Mon Sep 17 00:00:00 2001 From: Chris Freehill Date: Wed, 11 Mar 2020 12:11:29 -0500 Subject: [PATCH] Don't assert or re-throw exception caught at top level Instead, return error and let caller deal with it. Change-Id: I1a55337134b00aa4259af27281b2450fc2252be9 [ROCm/amdsmi commit: d54a9484beabe9936ae3e81e5ce159c15cd905df] --- projects/amdsmi/src/rocm_smi.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/projects/amdsmi/src/rocm_smi.cc b/projects/amdsmi/src/rocm_smi.cc index d1ab6b57ab..87c550a993 100755 --- a/projects/amdsmi/src/rocm_smi.cc +++ b/projects/amdsmi/src/rocm_smi.cc @@ -81,16 +81,13 @@ static rsmi_status_t handleException() { debug_print("Exception caught: %s.\n", e.what()); return e.error_code(); } catch (const std::exception& e) { - debug_print("Unhandled exception: %s\n", e.what()); - assert(false && "Unhandled exception."); + debug_print("Exception caught: %s\n", e.what()); return RSMI_STATUS_INTERNAL_EXCEPTION; } catch (const std::nested_exception& e) { - debug_print("Callback threw, forwarding.\n"); - e.rethrow_nested(); + debug_print("Callback threw.\n"); return RSMI_STATUS_INTERNAL_EXCEPTION; } catch (...) { - assert(false && "Unhandled exception."); - abort(); + debug_print("Unknown exception caught.\n"); return RSMI_STATUS_INTERNAL_EXCEPTION; } }