Seq arrange better exception handling

This commit is contained in:
Lukas Matena 2025-02-26 06:21:08 +01:00
parent 243101f20f
commit e93caf1a92
3 changed files with 7 additions and 5 deletions

View File

@ -28,7 +28,6 @@ using namespace Slic3r;
namespace Sequential
{
class ObjectTooLargeException : public std::runtime_error { public: explicit ObjectTooLargeException(const std::string& msg) : std::runtime_error(msg) {}};
class InternalErrorException : public std::runtime_error { public: explicit InternalErrorException(const std::string& msg) : std::runtime_error(msg) {} };

View File

@ -742,7 +742,7 @@ void prepare_ExtruderPolygons(const SolverConfiguration &solver
}
else
{
throw InternalErrorException("MISMATCH BETWEEN OBJECT AND PRINTER SLICE HEIGHTS.");
throw std::runtime_error("MISMATCH BETWEEN OBJECT AND PRINTER SLICE HEIGHTS.");
}
}
}

View File

@ -33,8 +33,11 @@ void SeqArrangeJob::process(Ctl& ctl)
}
);
} catch (const SeqArrangeJobException&) {
// The task was canceled. Just make sure that the progress notification disappears.
ctl.update_status(100, "");
ctl.update_status(100, ""); // Hide progress notification.
}
catch (const std::exception&) {
ctl.update_status(100, ""); // Hide progress notification.
throw;
}
}
@ -60,7 +63,7 @@ void SeqArrangeJob::finalize(bool canceled, std::exception_ptr& eptr)
dlg.ShowModal();
error = true;
eptr = nullptr; // The exception is handled.
} catch (const Sequential::InternalErrorException& ex) {
} catch (const std::runtime_error& ex) {
ErrorDialog dlg(wxGetApp().plater(), GUI::format_wxstr(_L("Internal error: %1%"), ex.what()), false);
dlg.ShowModal();
error = true;