Skip to content

Commit

Permalink
Merge pull request #6107 from DonLakeFlyer/TerrainErrorLogging
Browse files Browse the repository at this point in the history
Terrain: Better logging for errors
  • Loading branch information
DonLakeFlyer authored Feb 4, 2018
2 parents 45d8d89 + 4e2e5ab commit 24e27d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Terrain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ void TerrainBatchManager::_batchFailed(void)

void TerrainBatchManager::_requestFinished()
{
qCDebug(ElevationProviderLog) << "_requestFinished";
QNetworkReply* reply = qobject_cast<QNetworkReply*>(QObject::sender());

_state = State::Idle;

// When an error occurs we still end up here
if (reply->error() != QNetworkReply::NoError) {
qCDebug(ElevationProviderLog) << "_requestFinished error:" << reply->error();
_batchFailed();
reply->deleteLater();
return;
Expand All @@ -129,6 +129,7 @@ void TerrainBatchManager::_requestFinished()
QJsonParseError parseError;
QJsonDocument responseJson = QJsonDocument::fromJson(responseBytes, &parseError);
if (parseError.error != QJsonParseError::NoError) {
qCDebug(ElevationProviderLog) << "_requestFinished unable to parse json:" << parseError.errorString();
_batchFailed();
reply->deleteLater();
return;
Expand All @@ -137,6 +138,7 @@ void TerrainBatchManager::_requestFinished()
QJsonObject rootObject = responseJson.object();
QString status = rootObject["status"].toString();
if (status != "success") {
qCDebug(ElevationProviderLog) << "_requestFinished status != success:" << status;
_batchFailed();
reply->deleteLater();
return;
Expand Down

0 comments on commit 24e27d2

Please sign in to comment.