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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:19 +0000 (14:05 -0400)
commitd09c69f7ecf93e6d9d064a0453cf971ee3ff7778
treed206e7611b248a256c568c1b87d9f83e0da0108a
parent48e95b3d0a409b028cd2a7cb779e0a6ea5cb8004
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.025813 seconds and 4 git commands to generate.