aboutsummaryrefslogtreecommitdiff
path: root/src/mm-error-helpers.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-10-26 10:54:17 +0000
committerAleksander Morgado <aleksander@aleksander.es>2023-10-27 11:34:26 +0200
commit1f9a04268f6de7e9aa11073f0bf363aadc2ca29b (patch)
tree64519e385d67a5a9353681ddd39b15e979d5ead0 /src/mm-error-helpers.h
parent9569b99f4197ca4de57a97840a573304389fbc11 (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-error-helpers.h')
-rw-r--r--src/mm-error-helpers.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mm-error-helpers.h b/src/mm-error-helpers.h
index ec1c2c6b..c0e70e1f 100644
--- a/src/mm-error-helpers.h
+++ b/src/mm-error-helpers.h
@@ -34,4 +34,20 @@ void mm_register_error_mapping (GQuark input_erro
GQuark output_error_domain,
gint output_error_code);
+/* Replacements for the dbus method invocation completions but with our error normalization
+ * procedure in place, so that we only report back MM-specific errors. */
+void mm_dbus_method_invocation_take_error (GDBusMethodInvocation *invocation,
+ GError *error);
+void mm_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation,
+ GQuark domain,
+ gint code,
+ const gchar *message);
+void mm_dbus_method_invocation_return_error (GDBusMethodInvocation *invocation,
+ GQuark domain,
+ gint code,
+ const gchar *format,
+ ...) G_GNUC_PRINTF(4, 5);;
+void mm_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation,
+ const GError *error);
+
#endif /* MM_ERROR_HELPERS_H */