show error dialog only once per session

This commit is contained in:
Ian Chua
2026-05-19 15:05:51 +08:00
parent a5fd629bcc
commit 8e3caf4752

View File

@@ -4849,11 +4849,12 @@ void GUI_App::on_http_error(wxCommandEvent &evt)
return; return;
} }
static bool m_show_api_error = false;
// Show general error notification for Orca Cloud API failures (not Bambu) // Show general error notification for Orca Cloud API failures (not Bambu)
if (provider == ORCA_CLOUD_PROVIDER && status >= 400 && code != HttpErrorVersionLimited) { if (provider == ORCA_CLOUD_PROVIDER && status >= 400 && code != HttpErrorVersionLimited) {
if (m_show_http_error_msgdlg) if (m_show_api_error)
return; return;
m_show_http_error_msgdlg = true; m_show_api_error = true;
wxString msg; wxString msg;
if (!error.empty()) { if (!error.empty()) {
@@ -4862,7 +4863,6 @@ void GUI_App::on_http_error(wxCommandEvent &evt)
msg = wxString::Format(_L("API error (HTTP %u)"), status); msg = wxString::Format(_L("API error (HTTP %u)"), status);
} }
wxMessageBox(msg, _L("Orca Cloud API Error"), wxOK | wxICON_ERROR, wxGetApp().mainframe); wxMessageBox(msg, _L("Orca Cloud API Error"), wxOK | wxICON_ERROR, wxGetApp().mainframe);
m_show_http_error_msgdlg = false;
} }
} }