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

@@ -112,13 +112,9 @@ void AxivionProjectSettingsWidget::fetchProjects()
void AxivionProjectSettingsWidget::onDashboardInfoReceived(const DashboardInfo &info)
{
if (!info.error.isEmpty()) {
if (info.error.contains("credentials")) {
m_infoLabel->setText("Authentication failed. Check credentials settings.");
m_infoLabel->setType(Utils::InfoLabel::Error);
m_infoLabel->setVisible(true);
}
// send error to general message and discard results
// FIXME currently we do not get all errors - e.g. wrong curl calls
m_infoLabel->setText(info.error);
m_infoLabel->setType(Utils::InfoLabel::Error);
m_infoLabel->setVisible(true);
updateEnabledStates();
return;
}