Py: replace BaseExceptionFreeCADError with more suitable exception types
This commit is contained in:
@@ -183,7 +183,7 @@ PyObject* ExtensionContainerPy::hasExtension(PyObject *args) {
|
||||
if (extension.isBad() || !extension.isDerivedFrom(App::Extension::getExtensionClassTypeId())) {
|
||||
std::stringstream str;
|
||||
str << "No extension found of type '" << type << "'" << std::ends;
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError,str.str());
|
||||
throw Py::TypeError(str.str());
|
||||
}
|
||||
|
||||
bool val = false;
|
||||
@@ -212,7 +212,7 @@ PyObject* ExtensionContainerPy::addExtension(PyObject *args) {
|
||||
if (extension.isBad() || !extension.isDerivedFrom(App::Extension::getExtensionClassTypeId())) {
|
||||
std::stringstream str;
|
||||
str << "No extension found of type '" << typeId << "'" << std::ends;
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError,str.str());
|
||||
throw Py::TypeError(str.str());
|
||||
}
|
||||
|
||||
//register the extension
|
||||
@@ -222,7 +222,7 @@ PyObject* ExtensionContainerPy::addExtension(PyObject *args) {
|
||||
delete ext;
|
||||
std::stringstream str;
|
||||
str << "Extension is not a python addable version: '" << typeId << "'" << std::ends;
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError,str.str());
|
||||
throw Py::TypeError(str.str());
|
||||
}
|
||||
|
||||
GetApplication().signalBeforeAddingDynamicExtension(*getExtensionContainerPtr(), typeId);
|
||||
|
||||
Reference in New Issue
Block a user