diff options
author | Mandeep Sandhu <mandeepsandhu.chd@gmail.com> | 2013-11-15 18:42:22 +0530 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-30 07:56:47 +0100 |
commit | fd5dd2712656cbc674c8360754394e41dd82e40c (patch) | |
tree | 5067813ed024563a7aa7b1fac2199fcf4de27cd2 /src/network/access/qnetworkreply.h | |
parent | b584b6c478bae641ce6fbab25560bfb4ce831e5c (diff) |
Add more specific HTTP error codes to QNetworkReply::NetworkError
A few more HTTP status codes from the 4xx and 5xx series have been
added to QNetworkReply::NetworkError.
For content errors, the following codes have been added:
1. 409 - Resource Conflict
2. 410 - Resource Gone
For server related errors, the following codes have been added:
1. 500 - Internal Server Error
2. 501 - Operation Not Implemented
3. 503 - Service Unavailable
Few of the above codes are quite possible when communicating with REST
based services.
NOTE:
=====
* HTTP error status 400 is interpreted as
QNetworkReply::ProtocolInvalidOperationError.
* QNetworkReply::UnknownServerError is returned for all server related
errors (5xx) not listed above.
[ChangeLog][QtNetwork][QNetworkReply] Added more (specific) HTTP status
codes to NetworkError enum.
Task-number: QTBUG-30880
Change-Id: I9d2a133f6b3869f26710c6eb930dd8b08df31108
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'src/network/access/qnetworkreply.h')
-rw-r--r-- | src/network/access/qnetworkreply.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index a7db2d189c..f11a5e816a 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -93,12 +93,20 @@ public: ContentNotFoundError, AuthenticationRequiredError, ContentReSendError, + ContentConflictError, + ContentGoneError, UnknownContentError = 299, // protocol errors ProtocolUnknownError = 301, ProtocolInvalidOperationError, - ProtocolFailure = 399 + ProtocolFailure = 399, + + // Server side errors (401-499) + InternalServerError = 401, + OperationNotImplementedError, + ServiceUnavailableError, + UnknownServerError = 499 }; ~QNetworkReply(); |