bt2: make bt2 add graph listener wrappers append error causes
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Jul 2019 04:32:05 +0000 (00:32 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 04:18:54 +0000 (00:18 -0400)
commit416379bc0706641778bba7efbebaa5c6027e81b8
tree699265bfeb43c9eca3ab837923aaf6041ce408fc
parentee2cad25d5c65cd781169c897a53310cee9948fe
bt2: make bt2 add graph listener wrappers append error causes

If bt_bt2_graph_add_port_added_listener or
bt_bt2_graph_add_ports_connected_listener fail, it can be either because
one of the calls to the Babeltrace API fails or a Python object creation
fails.  On the Python side, we raise a bt2.Error on failure.  This seems
fine, although in a subsequent patch, it will become a pre-condition for
raising bt2.Error that we have an error set for the current thread.

Add some calls to BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN in
the errors paths of these wrappers that don't come from the library,
i.e. on which there would not already be an error cause appended.

On the Python side, use bt2.Error directly instead of
utils._raise_bt2_error.  Since these were the last call sites of
utils._raise_bt2_error, remove it.

Change-Id: I1556b626a941e9cc127fb036d6e3b9b6346fde88
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1745
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/graph.py
src/bindings/python/bt2/bt2/native_bt_graph.i
src/bindings/python/bt2/bt2/utils.py
This page took 0.024876 seconds and 4 git commands to generate.