Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
24e27d25
Unverified
Commit
24e27d25
authored
Feb 04, 2018
by
Don Gagne
Committed by
GitHub
Feb 04, 2018
Browse files
Merge pull request #6107 from DonLakeFlyer/TerrainErrorLogging
Terrain: Better logging for errors
parents
45d8d890
4e2e5abd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Terrain.cc
View file @
24e27d25
...
@@ -112,13 +112,13 @@ void TerrainBatchManager::_batchFailed(void)
...
@@ -112,13 +112,13 @@ void TerrainBatchManager::_batchFailed(void)
void
TerrainBatchManager
::
_requestFinished
()
void
TerrainBatchManager
::
_requestFinished
()
{
{
qCDebug
(
ElevationProviderLog
)
<<
"_requestFinished"
;
QNetworkReply
*
reply
=
qobject_cast
<
QNetworkReply
*>
(
QObject
::
sender
());
QNetworkReply
*
reply
=
qobject_cast
<
QNetworkReply
*>
(
QObject
::
sender
());
_state
=
State
::
Idle
;
_state
=
State
::
Idle
;
// When an error occurs we still end up here
// When an error occurs we still end up here
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
qCDebug
(
ElevationProviderLog
)
<<
"_requestFinished error:"
<<
reply
->
error
();
_batchFailed
();
_batchFailed
();
reply
->
deleteLater
();
reply
->
deleteLater
();
return
;
return
;
...
@@ -129,6 +129,7 @@ void TerrainBatchManager::_requestFinished()
...
@@ -129,6 +129,7 @@ void TerrainBatchManager::_requestFinished()
QJsonParseError
parseError
;
QJsonParseError
parseError
;
QJsonDocument
responseJson
=
QJsonDocument
::
fromJson
(
responseBytes
,
&
parseError
);
QJsonDocument
responseJson
=
QJsonDocument
::
fromJson
(
responseBytes
,
&
parseError
);
if
(
parseError
.
error
!=
QJsonParseError
::
NoError
)
{
if
(
parseError
.
error
!=
QJsonParseError
::
NoError
)
{
qCDebug
(
ElevationProviderLog
)
<<
"_requestFinished unable to parse json:"
<<
parseError
.
errorString
();
_batchFailed
();
_batchFailed
();
reply
->
deleteLater
();
reply
->
deleteLater
();
return
;
return
;
...
@@ -137,6 +138,7 @@ void TerrainBatchManager::_requestFinished()
...
@@ -137,6 +138,7 @@ void TerrainBatchManager::_requestFinished()
QJsonObject
rootObject
=
responseJson
.
object
();
QJsonObject
rootObject
=
responseJson
.
object
();
QString
status
=
rootObject
[
"status"
].
toString
();
QString
status
=
rootObject
[
"status"
].
toString
();
if
(
status
!=
"success"
)
{
if
(
status
!=
"success"
)
{
qCDebug
(
ElevationProviderLog
)
<<
"_requestFinished status != success:"
<<
status
;
_batchFailed
();
_batchFailed
();
reply
->
deleteLater
();
reply
->
deleteLater
();
return
;
return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment