diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index be83731d0..1c8683faf 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -4750,6 +4750,11 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) store_params.thumbnail_data, store_params.proFn, store_params.calibration_thumbnail_data, store_params.id_bboxes, store_params.project, store_params.export_plate_idx); if (result) { boost::filesystem::rename(filename + ".tmp", filename, ec); + if (ec) { + add_error("Failed to rename file: " + ec.message()); + boost::filesystem::remove(filename + ".tmp", ec); + return false; + } if (!(store_params.strategy & SaveStrategy::Silence)) boost::filesystem::save_string_file(store_params.model->get_backup_path() + "/origin.txt", filename); } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f9339f370..a95440197 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7414,7 +7414,11 @@ int Plater::save_project(bool saveAs) return wxID_CANCEL; //BBS export 3mf without gcode - export_3mf(into_path(filename), SaveStrategy::SplitModel); + if (export_3mf(into_path(filename), SaveStrategy::SplitModel) < 0) { + MessageDialog(this, _L("Failed to save project!\nPlease make sure the project file has not been opened by other program and try again."), + _L("Save project"), wxOK | wxICON_WARNING).ShowModal(); + return wxID_CANCEL; + } Slic3r::remove_backup(model(), false);