mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05: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:
parent
ac36cd6dcd
commit
9903fc0335
2 changed files with 5 additions and 2 deletions
|
@ -343,7 +343,10 @@ int serialize(PyObject* worker_capsule, PyObject* val, Obj* obj, std::vector<Obj
|
||||||
if (PyObject_IsInstance(*item, (PyObject*) &PyObjectIDType)) {
|
if (PyObject_IsInstance(*item, (PyObject*) &PyObjectIDType)) {
|
||||||
objectid = ((PyObjectID*) (*item))->id;
|
objectid = ((PyObjectID*) (*item))->id;
|
||||||
} else {
|
} 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;
|
return -1;
|
||||||
}
|
}
|
||||||
data->add_objectid_data(objectid);
|
data->add_objectid_data(objectid);
|
||||||
|
|
2
thirdparty/numbuf
vendored
2
thirdparty/numbuf
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 8e165d43d455925732d5361b79f818b6cead59ca
|
Subproject commit 7b548bddd337f2358fdf4a042f12c917a29da40d
|
Loading…
Add table
Reference in a new issue