From 6c60aa313c0598d9136f0bf6e2adc60654fc28d0 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 25 Nov 2016 16:13:03 +0100 Subject: introduce DBG_UNHANDLED_EXCEPTION_WHEN for calls with an explanatory message Change-Id: Ic80f2ed2c0fdff20d1ee1968bec2840bf914fb5e --- include/tools/diagnose_ex.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/tools') diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index bd0ec8818ba9..b3db8eb4986c 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -27,7 +27,9 @@ #include -TOOLS_DLLPUBLIC void DbgUnhandledException(const css::uno::Any& caughtException, const char* currentFunction, const char* fileAndLineNo); +TOOLS_DLLPUBLIC void DbgUnhandledException(const css::uno::Any& caughtException, + const char* currentFunction, const char* fileAndLineNo, + const char* explanatory = nullptr); #if OSL_DEBUG_LEVEL > 0 #include @@ -43,8 +45,12 @@ TOOLS_DLLPUBLIC void DbgUnhandledException(const css::uno::Any& caughtException, #define DBG_UNHANDLED_EXCEPTION() \ DbgUnhandledException( ::cppu::getCaughtException(), OSL_THIS_FUNC, SAL_DETAIL_WHERE); + #define DBG_UNHANDLED_EXCEPTION_WHEN(explain) \ + DbgUnhandledException( ::cppu::getCaughtException(), OSL_THIS_FUNC, SAL_DETAIL_WHERE, explain); + #else // OSL_DEBUG_LEVEL #define DBG_UNHANDLED_EXCEPTION() + #define DBG_UNHANDLED_EXCEPTION_WHEN(explain) #endif // OSL_DEBUG_LEVEL /** This macro asserts the given condition (in debug mode), and throws -- cgit