X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_component_class.i.h;h=6774ec6f522f7d8a9230cb555a7162246fa6ed2a;hb=561e7049fde1116fb0b25d902b8c158b309c8070;hp=ff736a8057c6e12a73b6d4886a81271a3651c0c4;hpb=87cd0f0b350a1ca1c65e98770d9a487e698eb37e;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index ff736a80..6774ec6f 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -799,11 +799,16 @@ bt_component_class_query_method_status component_class_query( py_object, py_params_ptr, method_data ? method_data : Py_None); if (!py_results_addr) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_WARNING, log_level, BT_LOG_TAG, - "Failed to call Python class's _bt_query_from_native() method: " - "py-cls-addr=%p", py_cls); status = py_exc_to_status_component_class(self_component_class, log_level); + if (status < 0) { + static const char *fmt = + "Failed to call Python class's _bt_query_from_native() method: py-cls-addr=%p"; + BT_LOG_WRITE_CUR_LVL(BT_LOG_WARNING, log_level, BT_LOG_TAG, + fmt, py_cls); + BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_COMPONENT_CLASS( + self_component_class, fmt, py_cls); + } goto end; }