LibreOffice Module comphelper (master) 1
|
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <sal/log.hxx>
#include <comphelper/comphelperdllapi.h>
#include <cppuhelper/exc_hlp.hxx>
Go to the source code of this file.
Macros | |
#define | DBG_UNHANDLED_EXCEPTION(...) |
reports a caught UNO exception via OSL diagnostics More... | |
#define | ENSURE_ARG_OR_THROW(c, m) |
This macro asserts the given condition (in debug mode), and throws an IllegalArgumentException afterwards. More... | |
#define | ENSURE_ARG_OR_THROW2(c, m, ifc, arg) |
#define | ENSURE_OR_THROW(c, m) |
This macro asserts the given condition (in debug mode), and throws a RuntimeException afterwards. More... | |
#define | ENSURE_OR_THROW2(c, m, ifc) |
#define | ENSURE_OR_RETURN(c, m, r) |
This macro asserts the given condition (in debug mode), and returns the given value afterwards. More... | |
#define | ENSURE_OR_RETURN_FALSE(c, m) ENSURE_OR_RETURN(c, m, false) |
This macro asserts the given condition (in debug mode), and returns false afterwards. More... | |
#define | ENSURE_OR_RETURN_VOID(c, m) |
This macro asserts the given condition (in debug mode), and returns afterwards, without return value "void". More... | |
#define | TOOLS_WARN_EXCEPTION(area, stream) |
Logs an message along with a nicely formatted version of the current exception. More... | |
#define | TOOLS_WARN_EXCEPTION_IF(cond, area, stream) |
Logs an message along with a nicely formatted version of the current exception. More... | |
#define | TOOLS_INFO_EXCEPTION(area, stream) |
Logs an message along with a nicely formatted version of the current exception. More... | |
Functions | |
COMPHELPER_DLLPUBLIC void | DbgUnhandledException (const css::uno::Any &caughtException, const char *currentFunction, const char *fileAndLineNo, const char *area, const char *explanatory=nullptr) |
css::uno::Any | DbgGetCaughtException () |
COMPHELPER_DLLPUBLIC OString | exceptionToString (css::uno::Any const &caughtEx) |
Convert a caught exception to a string suitable for logging. More... | |
#define DBG_UNHANDLED_EXCEPTION | ( | ... | ) |
reports a caught UNO exception via OSL diagnostics
Note that whenever you use this, it might be an indicator that your error handling is not correct... This takes two optional parameters: area and explanatory
Definition at line 75 of file diagnose_ex.hxx.
#define ENSURE_ARG_OR_THROW | ( | c, | |
m | |||
) |
This macro asserts the given condition (in debug mode), and throws an IllegalArgumentException afterwards.
Definition at line 82 of file diagnose_ex.hxx.
#define ENSURE_ARG_OR_THROW2 | ( | c, | |
m, | |||
ifc, | |||
arg | |||
) |
Definition at line 89 of file diagnose_ex.hxx.
#define ENSURE_OR_RETURN | ( | c, | |
m, | |||
r | |||
) |
This macro asserts the given condition (in debug mode), and returns the given value afterwards.
Definition at line 117 of file diagnose_ex.hxx.
#define ENSURE_OR_RETURN_FALSE | ( | c, | |
m | |||
) | ENSURE_OR_RETURN(c, m, false) |
This macro asserts the given condition (in debug mode), and returns false afterwards.
Definition at line 124 of file diagnose_ex.hxx.
#define ENSURE_OR_RETURN_VOID | ( | c, | |
m | |||
) |
This macro asserts the given condition (in debug mode), and returns afterwards, without return value "void".
Definition at line 130 of file diagnose_ex.hxx.
#define ENSURE_OR_THROW | ( | c, | |
m | |||
) |
This macro asserts the given condition (in debug mode), and throws a RuntimeException afterwards.
Definition at line 100 of file diagnose_ex.hxx.
#define ENSURE_OR_THROW2 | ( | c, | |
m, | |||
ifc | |||
) |
Definition at line 107 of file diagnose_ex.hxx.
#define TOOLS_INFO_EXCEPTION | ( | area, | |
stream | |||
) |
Logs an message along with a nicely formatted version of the current exception.
This must be called as the FIRST thing in a catch block.
Definition at line 186 of file diagnose_ex.hxx.
#define TOOLS_WARN_EXCEPTION | ( | area, | |
stream | |||
) |
Logs an message along with a nicely formatted version of the current exception.
This must be called as the FIRST thing in a catch block.
Definition at line 152 of file diagnose_ex.hxx.
#define TOOLS_WARN_EXCEPTION_IF | ( | cond, | |
area, | |||
stream | |||
) |
Logs an message along with a nicely formatted version of the current exception.
This must be called as the FIRST thing in a catch block.
Definition at line 169 of file diagnose_ex.hxx.
|
inline |
Definition at line 38 of file diagnose_ex.hxx.
COMPHELPER_DLLPUBLIC void DbgUnhandledException | ( | const css::uno::Any & | caughtException, |
const char * | currentFunction, | ||
const char * | fileAndLineNo, | ||
const char * | area, | ||
const char * | explanatory = nullptr |
||
) |
Definition at line 369 of file diagnose_ex.cxx.
References exceptionToStringImpl(), and sMessage.
COMPHELPER_DLLPUBLIC OString exceptionToString | ( | css::uno::Any const & | caughtEx | ) |
Convert a caught exception to a string suitable for logging.
Definition at line 362 of file diagnose_ex.cxx.
References exceptionToStringImpl(), and sMessage.
Referenced by exceptionToStringImpl().