Py: replace BaseExceptionFreeCADError with more suitable exception types
This commit is contained in:
@@ -234,7 +234,7 @@ PyObject* DocumentPy::addObject(PyObject *args, PyObject *kwd)
|
||||
if (!pcFtr) {
|
||||
std::stringstream str;
|
||||
str << "No document object found of type '" << sType << "'" << std::ends;
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError,str.str());
|
||||
throw Py::TypeError(str.str());
|
||||
}
|
||||
// Allows to hide the handling with Proxy in client python code
|
||||
if (obj) {
|
||||
@@ -300,7 +300,7 @@ PyObject* DocumentPy::removeObject(PyObject *args)
|
||||
else {
|
||||
std::stringstream str;
|
||||
str << "No document object found with name '" << sName << "'" << std::ends;
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError,str.str());
|
||||
throw Py::ValueError(str.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ PyObject* DocumentPy::moveObject(PyObject *args)
|
||||
}
|
||||
else {
|
||||
std::string str("Failed to move the object");
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError,str);
|
||||
throw Py::ValueError(str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user