Py: replace BaseExceptionFreeCADError with more suitable exception types

This commit is contained in:
wmayer
2022-03-17 13:54:23 +01:00
parent 18847444d4
commit 1f12dca2b4
38 changed files with 148 additions and 133 deletions

View File

@@ -160,7 +160,7 @@ PyObject* PointsPy::addPoints(PyObject * args)
}
}
catch (const Py::Exception&) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "either expect\n"
PyErr_SetString(PyExc_TypeError, "either expect\n"
"-- [Vector,...] \n"
"-- [(x,y,z),...]");
return nullptr;
@@ -190,7 +190,7 @@ PyObject* PointsPy::fromSegment(PyObject * args)
return new PointsPy(pts.release());
}
catch (const Py::Exception&) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "expect a list of int");
PyErr_SetString(PyExc_TypeError, "expect a list of int");
return nullptr;
}
}
@@ -212,7 +212,7 @@ PyObject* PointsPy::fromValid(PyObject * args)
return new PointsPy(pts.release());
}
catch (const Py::Exception&) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "expect a list of int");
PyErr_SetString(PyExc_TypeError, "expect a list of int");
return nullptr;
}
}