bt2: rename CreationError to MemoryError, handle it in and out of Python bindings
Babeltrace API calls can explicitly return the MEMORY_ERROR status,
which is currently converted to a bt2.Error in Python. If this
bt2.Error goes back to the native side of the bindings, is is converted
back to the ERROR status. This is not ideal, as the status value should
stay MEMORY_ERROR when unwinding the stack.
Also, when creation functions fail (return NULL/None), we currently
raise a CreationError. Those creation functions only return NULL/None
if there were memory issues, there is not other way they can
legitimately fail (otherwise they would return a status). So it would
make sense for this to be reported as a MEMORY_ERROR.
To address these two issues, this patch:
- renames bt2.CreationError to bt2.MemoryError
- makes utils._handle_func_status raise a bt2.MemoryError when receiving
the MEMORY_ERROR status
- makes the native bindings return MEMORY_ERROR when catching a
bt2.MemoryError
Since there's no easy way to generate an actual MemoryError, I tested
this manually by hacking bt_graph_create to make it fail.
Change-Id: I4969e8ccd9618d8361fe45d0973df980bc9b7abd
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1751
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
14 files changed:
This page took 0.02581 seconds and 4 git commands to generate.