JuliaPy / PythonCall.jl

Python and Julia in harmony.
https://juliapy.github.io/PythonCall.jl/stable/
MIT License
776 stars 63 forks source link

print caught exceptions when (de)serializing #332

Closed glennmoy closed 1 year ago

glennmoy commented 1 year ago

The caught exception can useful for tracking down sources of bugs, as was the case for myself earlier today.

cjdoris commented 1 year ago

I wonder if it's better to print a @debug log message instead.

Either way, please wrap this all in another try-catch block in case the sprint call fails for whatever reason. It's essential that this code doesn't throw.

glennmoy commented 1 year ago

I wonder if it's better to print a @debug log message instead.

Either way, please wrap this all in another try-catch block in case the sprint call fails for whatever reason. It's essential that this code doesn't throw.

sure - let me know if you think it's a good idea to print a second error message in the catch block... I figured it should say it tried to do display the original error without getting too self-referential.

cjdoris commented 1 year ago

Looks good, thanks!