mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 04:45:53 +08:00
Seq arrange better exception handling
This commit is contained in:
parent
243101f20f
commit
e93caf1a92
@ -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) {} };
|
||||
|
||||
|
||||
|
||||
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user