mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-21 20:25:20 +00:00
feat: add UI feedback on http error and some logs
This commit is contained in:
@@ -4848,6 +4848,22 @@ void GUI_App::on_http_error(wxCommandEvent &evt)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Show general error notification for Orca Cloud API failures (not Bambu)
|
||||
if (provider == ORCA_CLOUD_PROVIDER && status >= 400 && code != HttpErrorVersionLimited) {
|
||||
if (m_show_http_errpr_msgdlg)
|
||||
return;
|
||||
m_show_http_errpr_msgdlg = true;
|
||||
|
||||
wxString msg;
|
||||
if (!error.empty()) {
|
||||
msg = wxString::Format(_L("API error (HTTP %u): %s"), status, wxString::FromUTF8(error));
|
||||
} else {
|
||||
msg = wxString::Format(_L("API error (HTTP %u)"), status);
|
||||
}
|
||||
wxMessageBox(msg, _L("Orca Cloud API Error"), wxOK | wxICON_ERROR, wxGetApp().mainframe);
|
||||
m_show_http_errpr_msgdlg = false;
|
||||
}
|
||||
}
|
||||
|
||||
void GUI_App::enable_user_preset_folder(bool enable)
|
||||
|
||||
@@ -1304,6 +1304,7 @@ void OrcaCloudServiceAgent::load_sync_state()
|
||||
}
|
||||
}
|
||||
} catch (...) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "load_sync_state: failed to read sync state file, resetting timestamp to 0";
|
||||
sync_state.last_sync_timestamp = 0;
|
||||
}
|
||||
}
|
||||
@@ -1322,7 +1323,9 @@ void OrcaCloudServiceAgent::save_sync_state()
|
||||
ofs.close();
|
||||
boost::filesystem::rename(tmp_path, sync_state_path);
|
||||
}
|
||||
} catch (...) {}
|
||||
} catch (...) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "save_sync_state: failed to write sync state file";
|
||||
}
|
||||
}
|
||||
|
||||
void OrcaCloudServiceAgent::clear_sync_state()
|
||||
@@ -2230,7 +2233,9 @@ void OrcaCloudServiceAgent::json_to_map(const std::string& json, std::map<std::s
|
||||
map[it.key()] = it.value().dump();
|
||||
}
|
||||
}
|
||||
} catch (...) {}
|
||||
} catch (...) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "json_to_map: failed to parse JSON";
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user