From f9bfc8b91cd8ea755808751ab6268e37ffd6c17a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jul 2017 13:16:25 -0700 Subject: QSystemError: Make it format unknown Windows messages Can happen if we're using HRESULT from weird facilities. Change-Id: I3d10feaa2e5854ff3c01b32dbd068309e5131d1b Reviewed-by: Friedemann Kleint --- src/corelib/kernel/qsystemerror.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp index 6583838a9f..fc825257ec 100644 --- a/src/corelib/kernel/qsystemerror.cpp +++ b/src/corelib/kernel/qsystemerror.cpp @@ -103,6 +103,9 @@ static QString windowsErrorString(int errorCode) ret = QString::fromLatin1("The specified module could not be found."); if (ret.endsWith(QLatin1String("\r\n"))) ret.chop(2); + if (ret.isEmpty()) + ret = QString::fromLatin1("Unknown error 0x%1.") + .arg(unsigned(errorCode), 8, 16, QLatin1Char('0')); return ret; } #endif -- cgit v1.2.3