[gst-devel] Re: error handling in GStreamer

Ronald Bultje rbultje at ronald.bitfreak.net
Fri Sep 19 12:48:00 CEST 2003


Hi,

On Fri, 2003-09-19 at 16:33, Thomas Vander Stichele wrote:
>      gst_element_gerror (GST_ERROR_DEVICE,
>                          g_strdup_printf (_("%s not accessible",
>                                           device),
>                          g_strdup_printf ("no write permissions on %s",
>                                           device));

I'd love to have a reference to the original element as well, so I
prefer gst_element_error (GstElement *element, GstErrorCategory cat,
gchar *user_error, gchar *developer_error);.
Also, can you make a macro for this please? I'd *hate* to see each
plugin using "gst_element_gerror (GST_ELEMENT (el), GST_ERROR_BLABLA,
g_strdup_printf("%s", "eek"), g_strdup_printf ("%d", state)); when you
could also use gst_element_merror (el, GST_ERROR_BLABLA, ("%s, "eek"),
("%d", state));, so that the macro is defined as:

#define gst_element_merror(el, cat, str, dbg) \
  gst_element_gerror (GST_ELEMENT (el), (cat), \
		      g_strdup_printf (str), \
		      g_strdup_printf (dbg));

or whatever macro obfuscation is needed to make this work as it's meant
to.

It seems minor, but in the end, it'll save a lot of typing.

Apart from that, it seems fine. i18n and usability is good, but it's
also good to have technical error information if we need it. This seems
ok.

Ronald

-- 
Ronald Bultje <rbultje at ronald.bitfreak.net>





More information about the gstreamer-devel mailing list