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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:22 +0000 (11:58 -0400)
commitafe3f8ceca2dd8aa2fe5e08bab828bd841e0536a
tree97cd16fc087697444f8146d51268390a3b357427
parentb8dbd7aca30ad71fbf8afafd77bb550263a76d08
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.025714 seconds and 4 git commands to generate.