diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index 0822210692..740b37158a 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -1154,11 +1154,16 @@ PyObject* SketchObjectPy::split(PyObject *args) return nullptr; Base::Vector3d v1 = static_cast(pcObj)->value(); - if (this->getSketchObjectPtr()->split(GeoId,v1)) { - std::stringstream str; - str << "Not able to split curve with the given index: " << GeoId; - PyErr_SetString(PyExc_ValueError, str.str().c_str()); - return nullptr; + try { + if (this->getSketchObjectPtr()->split(GeoId,v1)) { + std::stringstream str; + str << "Not able to split curve with the given index: " << GeoId; + PyErr_SetString(PyExc_ValueError, str.str().c_str()); + return nullptr; + } + } + catch (const Base::ValueError & e) { + throw Py::ValueError(e.getMessage()); } Py_Return;