WIP Refactoring of exceptions:

1) All slicer's exceptions are now derived from Slic3r::Exception.
2) New exceptions are defined for slicing errors.
3) Exceptions are propagated to the Plater to show.
It remains to modify the slicing back-end to throw the new SlicingError
exceptions instead of std::runtime_error and to show the other exceptions
by a message dialog instead of a notification.
This commit is contained in:
Vojtech Bubnik 2020-09-14 16:27:55 +02:00
parent 6ac1935932
commit 067cde85f1
59 changed files with 356 additions and 249 deletions

View file

@ -1,3 +1,4 @@
#include "Exception.hpp"
#include "Print.hpp"
#include "BoundingBox.hpp"
#include "ClipperUtils.hpp"
@ -138,7 +139,7 @@ void PrintObject::slice()
}
});
if (m_layers.empty())
throw std::runtime_error("No layers were detected. You might want to repair your STL file(s) or check their size or thickness and retry.\n");
throw Slic3r::RuntimeError("No layers were detected. You might want to repair your STL file(s) or check their size or thickness and retry.\n");
this->set_done(posSlice);
}
@ -426,7 +427,7 @@ void PrintObject::generate_support_material()
// therefore they cannot be printed without supports.
for (const Layer *layer : m_layers)
if (layer->empty())
throw std::runtime_error("Levitating objects cannot be printed without supports.");
throw Slic3r::RuntimeError("Levitating objects cannot be printed without supports.");
#endif
}
this->set_done(posSupportMaterial);