summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qsystemerror.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-07-07 13:16:25 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-07-18 15:51:30 +0000
commitf9bfc8b91cd8ea755808751ab6268e37ffd6c17a (patch)
treeb592691294d309ec0ab324103df9b07b396d2e75 /src/corelib/kernel/qsystemerror.cpp
parentbf410ed529789f89a63af6a35bb06837b31b95a2 (diff)
QSystemError: Make it format unknown Windows messages
Can happen if we're using HRESULT from weird facilities. Change-Id: I3d10feaa2e5854ff3c01b32dbd068309e5131d1b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib/kernel/qsystemerror.cpp')
-rw-r--r--src/corelib/kernel/qsystemerror.cpp3
1 files changed, 3 insertions, 0 deletions
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