Merge pull request #15669 from marioalexis84/fem-link_scope_python_objects
Fem: Fix link scope for Python objects
This commit is contained in:
@@ -612,6 +612,23 @@ PyObject* AttributeError::getPyExceptionType() const
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
PropertyError::PropertyError() = default;
|
||||
|
||||
PropertyError::PropertyError(const char* sMessage)
|
||||
: AttributeError(sMessage)
|
||||
{}
|
||||
|
||||
PropertyError::PropertyError(const std::string& sMessage)
|
||||
: AttributeError(sMessage)
|
||||
{}
|
||||
|
||||
PyObject* PropertyError::getPyExceptionType() const
|
||||
{
|
||||
return PyExc_FC_PropertyError;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
RuntimeError::RuntimeError() = default;
|
||||
|
||||
RuntimeError::RuntimeError(const char* sMessage)
|
||||
|
||||
@@ -670,6 +670,26 @@ public:
|
||||
PyObject* getPyExceptionType() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
* The PropertyError can be used to indicate the usage of a wrong property name or value.
|
||||
* @author Mario Passaglia
|
||||
*/
|
||||
class BaseExport PropertyError: public AttributeError
|
||||
{
|
||||
public:
|
||||
/// Construction
|
||||
PropertyError();
|
||||
explicit PropertyError(const char* sMessage);
|
||||
explicit PropertyError(const std::string& sMessage);
|
||||
PropertyError(const PropertyError&) = default;
|
||||
PropertyError(PropertyError&&) = default;
|
||||
/// Destruction
|
||||
~PropertyError() noexcept override = default;
|
||||
PropertyError& operator=(const PropertyError&) = default;
|
||||
PropertyError& operator=(PropertyError&&) = default;
|
||||
PyObject* getPyExceptionType() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
* The RuntimeError can be used to indicate an unknown exception at runtime.
|
||||
* @author Werner Mayer
|
||||
|
||||
@@ -48,6 +48,7 @@ PyObject* Base::PyExc_FC_BadGraphError = nullptr;
|
||||
PyObject* Base::PyExc_FC_ExpressionError = nullptr;
|
||||
PyObject* Base::PyExc_FC_ParserError = nullptr;
|
||||
PyObject* Base::PyExc_FC_CADKernelError = nullptr;
|
||||
PyObject* Base::PyExc_FC_PropertyError = nullptr;
|
||||
|
||||
typedef struct { //NOLINT
|
||||
PyObject_HEAD
|
||||
|
||||
@@ -430,6 +430,7 @@ BaseExport extern PyObject* PyExc_FC_BadGraphError;
|
||||
BaseExport extern PyObject* PyExc_FC_ExpressionError;
|
||||
BaseExport extern PyObject* PyExc_FC_ParserError;
|
||||
BaseExport extern PyObject* PyExc_FC_CADKernelError;
|
||||
BaseExport extern PyObject* PyExc_FC_PropertyError;
|
||||
|
||||
/** Exception handling for python callback functions
|
||||
* Is a convenience macro to manage the exception handling of python callback
|
||||
|
||||
Reference in New Issue
Block a user