[Core] Persistence: improve NotImplemented exception presentation to user

This commit is contained in:
0penBrain
2022-04-06 10:36:32 +02:00
committed by wwmayer
parent 5cb11cb562
commit b7860d20e6

View File

@@ -70,6 +70,10 @@ PyObject* PersistencePy::dumpContent(PyObject *args, PyObject *kwds)
try {
getPersistencePtr()->dumpToStream(stream, compression);
}
catch(Base::NotImplementedError&) {
PyErr_SetString(PyExc_NotImplementedError, "Dumping content of this object type is not implemented");
return nullptr;
}
catch (...) {
PyErr_SetString(PyExc_IOError, "Unable to parse content into binary representation");
return nullptr;