Re: error handling in GStreamer

On Fri, 2003-09-19 at 20:59, Havoc Pennington wrote:
> Hi,
> Providing source line with the error seems pretty strange, unless you're
> reporting errors where you should be using g_assert() or g_error(). You
> only want to report an error for problems external to the program, not
> bugs in the program, right?

It's mainly for a third class of errors.  There are errors that seem to
be errors to the user, but aren't to the library.  For example, a user
tries to play a media file, but GStreamer can't decode it for some
reason even though it found the type.

GStreamer will report the media is broken, and the user will ask "but it
works fine in XYZ".  Which is where it can be useful for us to know what
exactly seems to have gone wrong inside GStreamer.  Did it find the
correct codec, but did something inside the plugin fail ? (caps
negotation, parsing, whatever).  Maybe it found the wrong codec, and
it's stuck in some typefind of the wrong plugin ?

The user can't tell, and we can't ask them.  Getting source code file,
line number and so on tells us, as developers, what the problem could be
and allows us to either fix it, improve on error reporting, or figure
out what else to do in this case.

Does that make more sense ?

The point is GStreamer abstracts a way a lot, so in the cases where it
fails it makes sense to be able to provide more debugging info on why it


Dave/Dina : future TV today ! -
<-*- thomas (dot) apestaart (dot) org -*->
Take my hands between your knees
Once inside
I'll only take the things that shine
You always said those things were mine
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! -

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]