Tweak error handling a bit

Always get http headers of the response to be able
to handle issues more explicitly.
These headers also contain additional information
we will need later on.

Change-Id: I062e97726a473c16b29cd84be0aa37260bac4ed8
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2022-12-16 08:55:20 +01:00
parent 82bd1de936
commit cc0b392e87
3 changed files with 69 additions and 21 deletions

View File

@@ -39,7 +39,7 @@ AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *paren
const AxivionServer server = settings->server;
QStringList args = server.curlArguments();
// TODO handle paginated results
args << "-i";
args << "--header" << "Authorization: AxToken " + server.token;
QString url = server.dashboard;
@@ -62,7 +62,7 @@ AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *paren
start();
return;
}
// output error to general message
emit resultRetrieved(m_process.readAllStandardError());
} else {
emit resultRetrieved(m_process.readAllStandardOutput());
}