diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-20 21:37:03 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-21 12:10:55 (GMT) |
commit | 0a9e29a58bd501af2e52f868386b27b29ebb1a72 (patch) | |
tree | ac9cc93f2c919ac52613e7f29a3764c729d574f0 /src/network/access/qhttpnetworkconnection.cpp | |
parent | 694be5a31be7e24761753ab9eccd87e8d08607e0 (diff) | |
download | Qt-0a9e29a58bd501af2e52f868386b27b29ebb1a72.zip Qt-0a9e29a58bd501af2e52f868386b27b29ebb1a72.tar.gz Qt-0a9e29a58bd501af2e52f868386b27b29ebb1a72.tar.bz2 |
QNAM HTTP: make it give some better error messages in case of socket failure.
Reviewed-By: Peter Hartmann
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 20baac8..fff7097 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -564,7 +564,8 @@ bool QHttpNetworkConnectionPrivate::fillPipeline(QList<HttpMessagePair> &queue, } -QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket) +QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket, + const QString &extraDetail) { Q_ASSERT(socket); @@ -581,7 +582,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection closed")); break; case QNetworkReply::TimeoutError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed")); + errorString = QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Socket operation timed out")); break; case QNetworkReply::ProxyAuthenticationRequiredError: errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy requires authentication")); @@ -600,7 +601,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e break; default: // all other errors are treated as QNetworkReply::UnknownNetworkError - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed")); + errorString = extraDetail; break; } return errorString; |