Partial fix of v2.2.0 alpha2 Unhandled exception - extrusion width #3482

Exceptions thrown by Flow calculation were made explicit classes derived
from std::invalid_argument.

The PresetHints::recommended_thin_wall_thickness() newly catches these
exceptions and it shows the reason of why the hint is invalid.
This commit is contained in:
bubnikv 2020-02-18 12:26:48 +01:00
parent d1e3435956
commit 43f2171446
3 changed files with 45 additions and 10 deletions

View file

@ -27,6 +27,31 @@ enum FlowRole {
frSupportMaterialInterface,
};
class FlowError : public std::invalid_argument
{
public:
FlowError(const std::string& what_arg) : invalid_argument(what_arg) {}
FlowError(const char* what_arg) : invalid_argument(what_arg) {}
};
class FlowErrorNegativeSpacing : public FlowError
{
public:
FlowErrorNegativeSpacing();
};
class FlowErrorNegativeFlow : public FlowError
{
public:
FlowErrorNegativeFlow();
};
class FlowErrorMissingVariable : public FlowError
{
public:
FlowErrorMissingVariable(const std::string& what_arg) : FlowError(what_arg) {}
};
class Flow
{
public: