Skip to content

Commit 5bd2851

Browse files
committed
print caught exceptions when (de)serializing
1 parent e374e25 commit 5bd2851

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cpython/jlwrap.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ function _pyjl_serialize(self::PyPtr, ::PyPtr)
205205
b = take!(io)
206206
return PyBytes_FromStringAndSize(pointer(b), sizeof(b))
207207
catch e
208-
PyErr_SetString(POINTERS.PyExc_Exception, "error serializing this value")
208+
PyErr_SetString(
209+
POINTERS.PyExc_Exception,
210+
"error serializing this value. Caught exception $e"
211+
)
209212
return PyNULL
210213
end
211214
end
@@ -220,7 +223,10 @@ function _pyjl_deserialize(t::PyPtr, v::PyPtr)
220223
x = deserialize(io)
221224
return PyJuliaValue_New(t, x)
222225
catch e
223-
PyErr_SetString(POINTERS.PyExc_Exception, "error deserializing this value")
226+
PyErr_SetString(
227+
POINTERS.PyExc_Exception,
228+
"error deserializing this value. Caught exception $e"
229+
)
224230
return PyNULL
225231
end
226232
end

0 commit comments

Comments
 (0)