diff options
author | abcd <amos.choy@nokia.com> | 2012-07-30 13:54:48 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-02 07:16:28 +0200 |
commit | 29760b127b4f4a6de8d178f6049b05f1c338ffb0 (patch) | |
tree | a97abb21ddea3d3a3ea3be85867cff3164092de0 /src/plugins/geoservices/nokia/placesv2 | |
parent | f5c58c6a3d77aeee1f8d3bc152aa3731efefac0e (diff) | |
download | qtlocation-29760b127b4f4a6de8d178f6049b05f1c338ffb0.tar.gz |
Fix incorrect error code during recommendation search
Previously a CommunicationError was returned if the id did not exist,
this was because an incorrect id would result in a non-esistent URL
being used. Now we make the assumption that if the URL content is not
found, then it must be because the id did not exist. In such a case
we can return a PlaceDoesNotExistError.
Change-Id: I50ddacb2341639dd6e227e795cefc5e92eea3d6e
Reviewed-by: Alex <alex.blasche@nokia.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/placesv2')
-rw-r--r-- | src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp b/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp index 8bcfd6a2..b82e3b20 100644 --- a/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp +++ b/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp @@ -103,6 +103,11 @@ void QPlaceSearchReplyImpl::replyFinished() case QNetworkReply::OperationCanceledError: setError(CancelError, QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, CANCEL_ERROR)); break; + case QNetworkReply::ContentNotFoundError: + setError(PlaceDoesNotExistError, + QString::fromLatin1("The id, %1, does not reference an existing place") + .arg(request().recommendationId())); + break; default: setError(CommunicationError, QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, NETWORK_ERROR)); } |