is there generic method to get the network error string out of the enum NetworkError or do i need to build one ?
I have basic function that prints network errors based on enum NetworkError.
that looks like this :
- {
- switch(networkError)
- {
- LOG_MSG("NO NETWORK CONNECTION ConnectionRefusedError!! ");
- break;
- //handle the html output is no internet connection is found
- LOG_MSG("NO NETWORK CONNECTION HostNotFoundError!! ");
- break;
- //handle the html output is no internet connection is found
- LOG_MSG("CONNECTION SslHandshakeFailedError!! ");
- break;
- LOG_MSG("CONNECTION UnknownContentError!! ");
- break;
- default :
- LOG_MSG("CONNECTION not defined default error UnknownContentError!! ");
- }
- }
now i need to support more errors , in fact all the error that list in enum NetworkError, so does it means i need to
added them all to this switch case ? or there is some kind of generic Qt functions that do this translation ?
5 replies
under the signal error [developer.qt.nokia.com]
you can find
The code parameter contains the code of the error that was detected. Call errorString() to obtain a textual representation of the error condition.
Did you try errorString() ?
When you list all members of QNertworkReply [developer.qt.nokia.com] there is an entry errorString()
So this should work
errorString is a member function of QIODevice and QNetworkReply inherits QIODevice.
You must log in to post a reply. Not a member yet? Register here!


