From 9903fc03354643689e168c5adb3a41dbdda163e1 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Tue, 9 Aug 2016 13:38:21 -0700 Subject: [PATCH] Improve error message for serialization of custom objects (#359) * Improve error message for serialization of custom objects * gitignore numbuf build directory --- src/raylib.cc | 5 ++++- thirdparty/numbuf | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/raylib.cc b/src/raylib.cc index faab42a2a..9ce43b2e3 100644 --- a/src/raylib.cc +++ b/src/raylib.cc @@ -343,7 +343,10 @@ int serialize(PyObject* worker_capsule, PyObject* val, Obj* obj, std::vectorid; } 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); diff --git a/thirdparty/numbuf b/thirdparty/numbuf index 8e165d43d..7b548bddd 160000 --- a/thirdparty/numbuf +++ b/thirdparty/numbuf @@ -1 +1 @@ -Subproject commit 8e165d43d455925732d5361b79f818b6cead59ca +Subproject commit 7b548bddd337f2358fdf4a042f12c917a29da40d