mirror of
https://github.com/wassname/ray.git
synced 2026-07-18 12:40:56 +08:00
Improve error message for serialization of custom objects (#359)
* Improve error message for serialization of custom objects * gitignore numbuf build directory
This commit is contained in:
committed by
Johann Schleier-Smith
parent
ac36cd6dcd
commit
9903fc0335
+4
-1
@@ -343,7 +343,10 @@ int serialize(PyObject* worker_capsule, PyObject* val, Obj* obj, std::vector<Obj
|
||||
if (PyObject_IsInstance(*item, (PyObject*) &PyObjectIDType)) {
|
||||
objectid = ((PyObjectID*) (*item))->id;
|
||||
} else {
|
||||
PyErr_SetString(PyExc_TypeError, "must be an object reference"); // TODO: improve error message
|
||||
std::stringstream ss;
|
||||
ss << "data type of " << PyString_AS_STRING(PyObject_Repr(*item))
|
||||
<< " not recognized";
|
||||
PyErr_SetString(PyExc_TypeError, ss.str().c_str());
|
||||
return -1;
|
||||
}
|
||||
data->add_objectid_data(objectid);
|
||||
|
||||
Vendored
+1
-1
Submodule thirdparty/numbuf updated: 8e165d43d4...7b548bddd3
Reference in New Issue
Block a user