amazon-ion / ion-python

A Python implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
260 stars 51 forks source link

Improve Python Error Handling from ioncmodule #310

Open rmarrowstone opened 1 year ago

rmarrowstone commented 1 year ago

Many of the calls to the Python C API in ioncmodule are not checked for NULL return values, which would indicate an error, for example in ionc_add_to_container. For the most part one would only encounter these errors when actively developing or if the hardware was truly out of memory (in which the process is pretty much cooked anyway). But having better error info would help during development and debugging.

Given that the ioncmodule code is intended to be called from the python interpreter it would be better to capture the Python error information to ensure that propagated into the Python exceptions that are thrown.