diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-11-24 11:31:28 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-05 09:20:28 +0000 |
commit | 57fbe96477107e2646b946c11a1bc0327e00457e (patch) | |
tree | e700da921bb967798a13852e46bb12ea15791960 /xmlsecurity | |
parent | 992b3c8644549218e6e2535eab7f8b239cf95a23 (diff) |
Show the message for the last Windows error also in our own error handler
That is what the default libxmlsec error handler,
xmlSecMSCryptoErrorsDefaultCallback(), does. Why show less information
in our own handler?
Also, bin a copy-pasted comment that is meaningless here and a useless 'using'.
Change-Id: Ibc9f9b5066536d0f5cabbf2bda6d1fa14eca5613
Reviewed-on: https://gerrit.libreoffice.org/31159
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/errorcallback.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx index d1b25b6e6dbc..dc817db1e0bd 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.cxx +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -17,16 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - -/* - * Implementation of the I/O interfaces based on stream and URI binding - */ #include "errorcallback.hxx" #include "xmlsec-wrapper.h" -using namespace ::com::sun::star::xml::crypto; - +#ifdef _WIN32 +#include <prewin.h> +#include <postwin.h> +#include "comphelper/windowserrorstring.hxx" +#endif extern "C" void errorCallback(const char* file, @@ -40,7 +39,13 @@ void errorCallback(const char* file, const char* pErrorObject = errorObject ? errorObject : ""; const char* pErrorSubject = errorSubject ? errorSubject : ""; const char* pMsg = msg ? msg : ""; - SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'"); + OUString systemErrorString; + +#ifdef _WIN32 + systemErrorString = " " + WindowsErrorString(GetLastError()); +#endif + + SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'" << systemErrorString); } void setErrorRecorder() |