From d6117788a87bee675454131923e75d5408febc6c Mon Sep 17 00:00:00 2001 From: Stone Li Date: Wed, 2 Nov 2022 10:54:41 +0800 Subject: [PATCH] ENH: handle 403 error when sync the user settings Change-Id: I33794d1f7354f369e76b83e90c8a03d2c349b545 Signed-off-by: Stone Li (cherry picked from commit a5edb419b49b18e7fa94b05d14aa215ed756076c) --- src/slic3r/GUI/GUI_App.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 435ef5104..99be41b95 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3650,8 +3650,15 @@ void GUI_App::sync_preset(Preset* preset) preset->setting_id.clear(); result = 0; } - else + else { result = m_agent->put_setting(preset->setting_id, preset->name, &values_map, &http_code); + if (http_code >= 400) { + result = 0; + updated_info = "hold"; + BOOST_LOG_TRIVIAL(error) << "[sync_preset] put setting_id = " << preset->setting_id << " failed, http_code = " << http_code; + } + } + } else { BOOST_LOG_TRIVIAL(trace) << "[sync_preset]update: can not generate differed key-values, we need to skip this preset "<< preset->name; @@ -3760,8 +3767,10 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg) it = delete_cache_presets.erase(it); BOOST_LOG_TRIVIAL(trace) << "sync_preset: sync operation: delete success! setting id = " << del_setting_id; } - else + else { + BOOST_LOG_TRIVIAL(info) << "delete setting = " <