[cairo] error handling questions

Behdad Esfahbod behdad at behdad.org
Sat Jul 7 17:33:55 PDT 2007


On Wed, 2007-07-04 at 11:29 -0700, Carl Worth wrote:
> 
> Uhm... are you trying to argue "it would have been better if we had
> used UNKNOWN_ERROR instead of NO_MEMORY originally". I probably
> wouldn't disagree there. But that's not an interesting question at
> all. The question is how to fix what we've got, (and UNKNOWN_ERROR is
> a non-fix). 

Yeah, that's more like what was going in my mind.  I kinda assumed that
by introducing UNKNOWN_ERROR we get someone go over the code and switch
all the bogus NO_MEMORY ones to UNKNOWN_ERROR.

Another problem is that since cairo_status_t values are part of the APU
we don't want introduce lots of status values that may fade away over
time.

Another option to improve the situation is to document every function
with which error statuses it may return, and mark NO_MEMORY as a special
"almost every function may return this" value.  That way at least adding
status values that may become unused later is a smaller problem.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list