From 302fc64041430f62d61c4a0832be3c3764ac0925 Mon Sep 17 00:00:00 2001 From: Mike Lundy Date: Thu, 3 Mar 2016 16:32:01 -0800 Subject: [PATCH] Include the traceback in exceptions This makes debugging into the cython side of the code much easier. --- capnp/lib/capnp.pyx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/capnp/lib/capnp.pyx b/capnp/lib/capnp.pyx index 55b3964..ab65392 100644 --- a/capnp/lib/capnp.pyx +++ b/capnp/lib/capnp.pyx @@ -1025,7 +1025,7 @@ cdef class _DynamicStructReader: try: return self._get(field) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] cpdef _get_by_field(self, _StructSchemaField field): return to_python_reader(self.thisptr.getByField(field.thisptr), self._parent) @@ -1225,7 +1225,7 @@ cdef class _DynamicStructBuilder: try: return self._get(field) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] cpdef _set(self, field, value): _setDynamicField(self.thisptr, field, value, self._parent) @@ -1237,7 +1237,7 @@ cdef class _DynamicStructBuilder: try: self._set(field, value) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] cpdef _has(self, field): return self.thisptr.has(field) @@ -1456,7 +1456,7 @@ cdef class _DynamicStructPipeline: try: return self._get(field) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] property schema: """A property that returns the _StructSchema object matching this reader""" @@ -1936,7 +1936,7 @@ cdef class _RemotePromise: try: return self._get(field) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] property schema: """A property that returns the _StructSchema object matching this reader""" @@ -2039,7 +2039,7 @@ cdef class _DynamicCapabilityServer: try: return getattr(self.server, field) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] cdef class _DynamicCapabilityClient: cdef C_DynamicCapability.Client thisptr @@ -2121,7 +2121,7 @@ cdef class _DynamicCapabilityClient: raise AttributeError('Method named %s not found' % name) return _partial(self._send, name) except KjException as e: - raise e._to_python() + raise e._to_python(), None, _sys.exc_info()[2] cpdef upcast(self, schema) except +reraise_kj_exception: cdef _InterfaceSchema s