bt_logging_level log_level = get_self_component_log_level(
self_component);
- BT_COMP_LOG_CUR_LVL(BT_LOG_WARNING, log_level, self_component,
- "User component's _user_finalize() method raised an exception: ignoring:");
- logw_exception(log_level);
-
/*
* Ignore any exception raised by the _user_finalize() method
* because it won't change anything at this point: the component
* is being destroyed anyway.
*/
- PyErr_Clear();
+ BT_COMP_LOG_CUR_LVL(BT_LOG_WARNING, log_level, self_component,
+ "User component's _user_finalize() method raised an exception: ignoring:");
+ logw_exception_clear(log_level);
+
goto end;
}
bt_logging_level log_level = get_self_component_log_level(
self_comp);
- BT_COMP_LOG_CUR_LVL(BT_LOG_WARNING, log_level, self_comp,
- "User's _user_finalize() method raised an exception: ignoring:");
- logw_exception(get_self_message_iterator_log_level(
- message_iterator));
-
/*
* Ignore any exception raised by the _user_finalize() method
* because it won't change anything at this point: the component
* is being destroyed anyway.
*/
- PyErr_Clear();
+ BT_COMP_LOG_CUR_LVL(BT_LOG_WARNING, log_level, self_comp,
+ "User's _user_finalize() method raised an exception: ignoring:");
+ logw_exception_clear(get_self_message_iterator_log_level(
+ message_iterator));
}
Py_XDECREF(py_method_result);
py_res = PyObject_CallFunction(py_callable, "(OiOi)",
py_component_ptr, component_class_type, py_port_ptr, port_type);
if (!py_res) {
- loge_exception_append_cause(
+ loge_exception_append_cause_clear(
"Graph's port added listener (Python)",
BT_LOG_OUTPUT_LEVEL);
- PyErr_Clear();
status = __BT_FUNC_STATUS_ERROR;
goto end;
}
py_downstream_component_ptr, downstream_component_class_type,
py_downstream_port_ptr);
if (!py_res) {
- loge_exception_append_cause(
+ loge_exception_append_cause_clear(
"Graph's port connected listener (Python)",
BT_LOG_OUTPUT_LEVEL);
- PyErr_Clear();
status = __BT_FUNC_STATUS_ERROR;
goto end;
}
}
static inline
-void loge_exception_append_cause(const char *module_name, int active_log_level)
+void loge_exception_append_cause_clear(const char *module_name, int active_log_level)
{
log_exception_and_maybe_append_cause(BT_LOG_ERROR, active_log_level,
true, NULL, NULL, NULL, module_name);
+ PyErr_Clear();
}
static inline
-void logw_exception(int active_log_level)
+void logw_exception_clear(int active_log_level)
{
log_exception_and_maybe_append_cause(BT_LOG_WARNING, active_log_level,
false, NULL, NULL, NULL, NULL);
+ PyErr_Clear();
}
py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_ptr);
if (!py_res) {
- logw_exception(BT_LOG_OUTPUT_LEVEL);
- PyErr_Clear();
+ logw_exception_clear(BT_LOG_OUTPUT_LEVEL);
goto end;
}
py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_class_ptr);
if (!py_res) {
- logw_exception(BT_LOG_OUTPUT_LEVEL);
- PyErr_Clear();
+ logw_exception_clear(BT_LOG_OUTPUT_LEVEL);
goto end;
}