diff options
author | Gaël Bonithon <gael@xfce.org> | 2021-12-26 00:06:34 +0100 |
---|---|---|
committer | Gaël Bonithon <gael@xfce.org> | 2021-12-26 18:30:04 +0100 |
commit | 49ffba98d7cf9626a1470bc49a53596300fe3550 (patch) | |
tree | 617a9acf683f60bcda0faa8446cacbefc8d423dc /tumbler | |
parent | ef518751bd744a48a165dc7c285f98b960c64a75 (diff) | |
download | tumbler-49ffba98d7cf9626a1470bc49a53596300fe3550.tar.gz |
Error handling: Fit to the spec and complete message if needed
A parameter is added to Tumbler's internal error signals to account for
the error domain, and the error code `TUMBLER_ERROR_OTHER_ERROR_DOMAIN`
is added to indicate that the error originated from a third-party API.
When sending the error signal via D-Bus, cancelling errors are filtered
out, and when the error originates from a third-party API, the error
message is prefixed with the domain and code of that error, in a
possibly parsable format.
Fixes #49.
Diffstat (limited to 'tumbler')
-rw-r--r-- | tumbler/tumbler-error.h | 1 | ||||
-rw-r--r-- | tumbler/tumbler-marshal.list | 7 | ||||
-rw-r--r-- | tumbler/tumbler-thumbnailer.c | 5 | ||||
-rw-r--r-- | tumbler/tumbler-thumbnailer.h | 1 |
4 files changed, 7 insertions, 7 deletions
diff --git a/tumbler/tumbler-error.h b/tumbler/tumbler-error.h index 036a7b8..938c67c 100644 --- a/tumbler/tumbler-error.h +++ b/tumbler/tumbler-error.h @@ -63,6 +63,7 @@ typedef enum /*< enum >*/ TUMBLER_ERROR_UNSUPPORTED_FLAVOR, TUMBLER_ERROR_NO_CONTENT, TUMBLER_ERROR_SHUTTING_DOWN, + TUMBLER_ERROR_OTHER_ERROR_DOMAIN, } TumblerErrorEnum; G_END_DECLS diff --git a/tumbler/tumbler-marshal.list b/tumbler/tumbler-marshal.list index 4a83ff1..acacac6 100644 --- a/tumbler/tumbler-marshal.list +++ b/tumbler/tumbler-marshal.list @@ -1,7 +1,4 @@ -VOID:STRING,INT,STRING -VOID:UINT,STRING,INT,STRING -VOID:UINT,BOXED,INT,STRING,STRING -VOID:STRING,INT,STRING +VOID:STRING,UINT,INT,STRING +VOID:UINT,BOXED,UINT,INT,STRING,STRING VOID:UINT,BOXED,STRING VOID:UINT,STRING -VOID:UINT,POINTER,INT,STRING diff --git a/tumbler/tumbler-thumbnailer.c b/tumbler/tumbler-thumbnailer.c index 67f0fc8..27d3177 100644 --- a/tumbler/tumbler-thumbnailer.c +++ b/tumbler/tumbler-thumbnailer.c @@ -114,10 +114,11 @@ tumbler_thumbnailer_default_init (TumblerThumbnailerIface *klass) G_STRUCT_OFFSET (TumblerThumbnailerIface, error), NULL, NULL, - tumbler_marshal_VOID__STRING_INT_STRING, + tumbler_marshal_VOID__STRING_UINT_INT_STRING, G_TYPE_NONE, - 3, + 4, G_TYPE_STRING, + G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); diff --git a/tumbler/tumbler-thumbnailer.h b/tumbler/tumbler-thumbnailer.h index 285626e..b983d4e 100644 --- a/tumbler/tumbler-thumbnailer.h +++ b/tumbler/tumbler-thumbnailer.h @@ -50,6 +50,7 @@ struct _TumblerThumbnailerIface const gchar *uri); void (*error) (TumblerThumbnailer *thumbnailer, const gchar *failed_uri, + GQuark error_domain, gint error_code, const gchar *message); void (*unregister) (TumblerThumbnailer *thumbnailer); |