[gst-devel] a general question re: error handling

Thomas Vander Stichele thomas at urgent.rug.ac.be
Mon Sep 30 04:42:15 CEST 2002


I've been adding error handling to gst-player, and now I find myself in 
the same situation for the editor.

If you start the editor, set the empty pipeline to play, then add an 
element, the app crashes on an assert because you're adding to a playing 
pipeline.

It'd be a lot nicer if it did
http://thomas.apestaart.org/download/screenshots/gst-editor-warning.png
instead.

Now, a few questions before I make Andy mad by adding all sorts of gtk 
crap to the source ;)

a) should the core fail with an assert, or should it return from the _add 
function with some sort of error state ? i.e., is the app responsible for 
checking if the assert won't be triggered ?

IMO, we have used asserts liberally inside the core, which is a good 
thing, but I believe asserts should only be used where they truely mean 
"this is the responsibility of the app programmer to ensure this condition 
never happens".  If this is the case, then some of those asserts may need 
to be re-evaluated.

In the case of gst_bin_add, I'm not sure what is the best behaviour.  
Should the app catch this precondition, or should the core return with a 
failure allowing the app to react to it ?

b) if it's the app's duty to do this, should we write a library that 
handles this in a generic way for all apps to use ?

c) should we start evaluating all of the core and apps to come up with a 
sane way to handle feedback, warnings and errors in a sane fashion ?

Thomas

-- 

The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
<-*-                      -*->
And if, my love,
I said I'm sorry
would you believe me ?
should I cry ?
<-*- thomas at apestaart.org -*->
URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/





More information about the gstreamer-devel mailing list