mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-28 19:21:20 -06:00
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:
parent
6ac1935932
commit
067cde85f1
59 changed files with 356 additions and 249 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "../ClipperUtils.hpp"
|
||||
#include "../EdgeGrid.hpp"
|
||||
#include "../Exception.hpp"
|
||||
#include "../Geometry.hpp"
|
||||
#include "../Surface.hpp"
|
||||
#include "../PrintConfig.hpp"
|
||||
|
|
@ -40,7 +41,7 @@ Fill* Fill::new_from_type(const InfillPattern type)
|
|||
case ipOctagramSpiral: return new FillOctagramSpiral();
|
||||
case ipAdaptiveCubic: return new FillAdaptive();
|
||||
case ipSupportCubic: return new FillSupportCubic();
|
||||
default: throw std::invalid_argument("unknown type");
|
||||
default: throw Slic3r::InvalidArgument("unknown type");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "../libslic3r.h"
|
||||
#include "../BoundingBox.hpp"
|
||||
#include "../Exception.hpp"
|
||||
#include "../Utils.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
|
@ -23,9 +24,10 @@ namespace FillAdaptive_Internal {
|
|||
struct Octree;
|
||||
};
|
||||
|
||||
class InfillFailedException : public std::runtime_error {
|
||||
// Infill shall never fail, therefore the error is classified as RuntimeError, not SlicingError.
|
||||
class InfillFailedException : public Slic3r::RuntimeError {
|
||||
public:
|
||||
InfillFailedException() : std::runtime_error("Infill failed") {}
|
||||
InfillFailedException() : Slic3r::RuntimeError("Infill failed") {}
|
||||
};
|
||||
|
||||
struct FillParams
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue