From 4212d68d9cd2e018d56393bfc9b483c600b0877a Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Thu, 28 May 2020 16:11:30 -0400 Subject: [PATCH] m-config-endpoint: show a warning if endpoint failed to activate or export --- modules/module-config-endpoint/context.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/module-config-endpoint/context.c b/modules/module-config-endpoint/context.c index 681cdebd..2acbd6f5 100644 --- a/modules/module-config-endpoint/context.c +++ b/modules/module-config-endpoint/context.c @@ -59,8 +59,10 @@ endpoint_export_finish_cb (WpSessionItem * ep, GAsyncResult * res, { g_autoptr (GError) error = NULL; gboolean export_ret = wp_session_item_export_finish (ep, res, &error); - g_return_if_fail (error == NULL); - g_return_if_fail (export_ret); + if (!export_ret) { + wp_warning_object (self, "failed to export endpoint: %s", error->message); + return; + } /* Emit the signal */ g_signal_emit (self, signals[SIGNAL_ENDPOINT_CREATED], 0, ep); @@ -74,8 +76,10 @@ endpoint_activate_finish_cb (WpSessionItem * ep, GAsyncResult * res, WpSession * session = NULL; g_autoptr (GError) error = NULL; gboolean activate_ret = wp_session_item_activate_finish (ep, res, &error); - g_return_if_fail (error == NULL); - g_return_if_fail (activate_ret); + if (!activate_ret) { + wp_warning_object (self, "failed to activate endpoint: %s", error->message); + return; + } /* Activate monitor if any */ monitor = g_object_get_qdata (G_OBJECT (ep), monitor_quark ());