bt2: don't show warning when query method raises a non-error exception
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 16 Aug 2019 03:05:13 +0000 (23:05 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 17 Aug 2019 05:31:37 +0000 (01:31 -0400)
commit561e7049fde1116fb0b25d902b8c158b309c8070
tree82579dc8d0e80d9e103ec586639182c3df3615ff
parent87cd0f0b350a1ca1c65e98770d9a487e698eb37e
bt2: don't show warning when query method raises a non-error exception

I noticed that when a Python query raised bt2.UnknownObject, we show
this warning:

W BT2-PY component_class_query@native_bt_component_class.i.h:802 Failed to call Python class's _bt_query_from_native() method: py-cls-addr=0x6190001090a0

In my opinion, a query returning "unknown object" is part of the normal
course of operation, and we should not show a warning.  So, only show it
when the exception gets translated to a status < 0.  Also, append an
error cause while at it in case of error.

Change-Id: I079f67b74df881ab000c6e223667ca72dcd52713
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1952
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/native_bt_component_class.i.h
tests/bindings/python/bt2/test_query_executor.py
This page took 0.025593 seconds and 4 git commands to generate.