Skip to content

Commit 4326734

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

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PythonCall"
22
uuid = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
33
authors = ["Christopher Doris <github.com/cjdoris>"]
4-
version = "0.9.13"
4+
version = "0.9.14"
55

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"

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)