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: d54a9484be]
This commit is contained in:
Chris Freehill
2020-03-11 12:11:29 -05:00
szülő 07c74cbe38
commit 0bafc0b65e
+3 -6
Fájl megtekintése
@@ -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;
}
}