You’ve probably had to write code that lives at the boundary between exception-based code and error-code-based code. HRESULT ConvertExceptionToHResult() { try { throw; } catch (MyCustomExceptionClass const& ex) { return ex.GetHResult(); } catch (std::bad_alloc const&) { return E_OUTOFMEMORY; } catch (...) { // Disallowed exception. The post If you want to terminate on an unexpected exception, then don’t sniff at ev...