From fa48b0596d45a54d2ba880b523df3872ecab64f7 Mon Sep 17 00:00:00 2001 From: Aleksei Vereshchagin Date: Mon, 11 Dec 2017 20:16:24 +0300 Subject: [PATCH] Profiler::HandleException() prints to LOG().Warn() for not FAILED HRESULTs --- src/profiler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/profiler.cpp b/src/profiler.cpp index efbe8b9..262e1c2 100644 --- a/src/profiler.cpp +++ b/src/profiler.cpp @@ -187,8 +187,16 @@ HRESULT Profiler::HandleException(const std::exception &e) const noexcept { if (pHresultException) { - LOG().Error() << "Exception: " << pHresultException->what() - << " (HR = " << pHresultException->hresult() << ")"; + if (FAILED(pHresultException->hresult())) + { + LOG().Error() << "Exception: " << pHresultException->what() + << " (HR = " << pHresultException->hresult() << ")"; + } + else + { + LOG().Warn() << "Exception: " << pHresultException->what() + << " (HR = " << pHresultException->hresult() << ")"; + } } else if (p_system_error) { -- 2.34.1