diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2023-10-26 10:54:17 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2023-10-27 11:34:26 +0200 |
commit | 1f9a04268f6de7e9aa11073f0bf363aadc2ca29b (patch) | |
tree | 64519e385d67a5a9353681ddd39b15e979d5ead0 /src/mm-iface-modem-signal.c | |
parent | 9569b99f4197ca4de57a97840a573304389fbc11 (diff) |
core: ensure all errors returned in DBus operations are normalized
We want to ensure that all errors reported via DBus operations are
normalized to MM-specific errors.
We don't want to return QMI or MBIM specific errors, as those are
protocol specific and we don't want DBus clients to need to rely on
knowing which is the protocol in use by the device.
Diffstat (limited to 'src/mm-iface-modem-signal.c')
-rw-r--r-- | src/mm-iface-modem-signal.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mm-iface-modem-signal.c b/src/mm-iface-modem-signal.c index fe7d0c7a..68c45ec6 100644 --- a/src/mm-iface-modem-signal.c +++ b/src/mm-iface-modem-signal.c @@ -20,6 +20,7 @@ #include "mm-iface-modem.h" #include "mm-iface-modem-signal.h" +#include "mm-error-helpers.h" #include "mm-log-object.h" #define SUPPORT_CHECKED_TAG "signal-support-checked-tag" @@ -380,7 +381,7 @@ handle_setup_auth_ready (MMBaseModem *_self, Private *priv; if (!mm_base_modem_authorize_finish (_self, res, &error)) { - g_dbus_method_invocation_take_error (ctx->invocation, error); + mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_setup_context_free (ctx); return; } @@ -455,7 +456,7 @@ setup_thresholds_restart_ready (MMIfaceModemSignal *self, if (!thresholds_restart_finish (self, res, &error)) { priv->rssi_threshold = ctx->previous_rssi_threshold; priv->error_rate_threshold = ctx->previous_error_rate_threshold; - g_dbus_method_invocation_take_error (ctx->invocation, error); + mm_dbus_method_invocation_take_error (ctx->invocation, error); } else { check_interface_reset (self); mm_gdbus_modem_signal_set_rssi_threshold (ctx->skeleton, priv->rssi_threshold); @@ -481,15 +482,15 @@ handle_setup_thresholds_auth_ready (MMBaseModem *_self, priv = get_private (self); if (!mm_base_modem_authorize_finish (_self, res, &error)) { - g_dbus_method_invocation_take_error (ctx->invocation, error); + mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_setup_thresholds_context_free (ctx); return; } if (!MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->setup_thresholds || !MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->setup_thresholds_finish) { - g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, - "Cannot setup thresholds: operation not supported"); + mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Cannot setup thresholds: operation not supported"); handle_setup_thresholds_context_free (ctx); return; } @@ -503,7 +504,7 @@ handle_setup_thresholds_auth_ready (MMBaseModem *_self, properties = mm_signal_threshold_properties_new_from_dictionary (ctx->settings, &error); if (!properties) { - g_dbus_method_invocation_take_error (ctx->invocation, error); + mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_setup_thresholds_context_free (ctx); return; } |