-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Some future release
-
None
-
Qt 5.2.1 Linux x86_64, and Android
For errors such as "host not found" or "connection refused" the QWebSocket::errorString() method returns the string "Unknown Error" event when the error() method returns the correct error code.
I've attached a quick test, that attempts to connect to ws://localhost:4343 and prints the errorString on state change.
The issue seems to be caused by the Ctor for QWebSocketPrivate that sets the value for m_errorString to QWebSocket::tr("Unknown error"), this in turn causes QWebSocketPrivate::errorString() to always fail a check against m_errorString.isEmpty(), and always returning "Unknown Error".
Attached is also a patch that leaves the default value for m_errorString as empty and sets it in errorString() instead.