Base: Allow to also throw exception by given Python type

This commit is contained in:
wmayer
2025-03-22 14:44:15 +01:00
committed by Benjamin Nauck
parent 2c60e83f25
commit 231680c9ce
3 changed files with 37 additions and 8 deletions

View File

@@ -114,12 +114,10 @@ void PyException::raiseException()
Base::ExceptionFactory::Instance().raiseException(edict.ptr());
}
if (_exceptionType == PyExc_FC_FreeCADAbort) {
AbortException exc(getMessage());
exc.setReported(getReported());
throw exc;
}
PyExceptionData data {_exceptionType, getMessage(), getReported()};
Base::ExceptionFactory::Instance().raiseExceptionByType(data);
// Fallback
throw *this;
}