[cairo] error handling questions

Travis Griggs tgriggs at cincom.com
Thu Jul 5 09:18:31 PDT 2007

On Jul 4, 2007, at 11:29, Carl Worth wrote:

> <snip>
> The point is, right now you might have a program that fails and prints
> a totally bogus error message:
> 	cairo is unhappy: out of memory
> And that leads to misleading bug reports. Which of the following
> replacements would lead to better bug reports?
> 	cairo is unhappy: unknown error
> 	cairo is unhappy: GDI error
> I know which one I would prefer to see.

GDIError would help a lot. For the situation I was having where users  
are telling me they're getting out-of-memory error notifiers, I'm  
running their code on OSX/X11 and wondering, what is going on here?

The windows error system is interesting in that it is common to set  
an error code, and then place further qualifying information in extra  
parameters. Strings for example. This is the same pattern that has  
been used for the win32 backend. You get one error code, the real  
info is on stderr. This is different from the traditional *nix  
approach where each error code is a pretty succinct error and and can  
be mapped statically to some sort of explanation string. I don't care  
about the mechanism, it would be nice from a language binding's pov  
to be able to report a string to the user that is more than just "GDI  
error" since that could be so many things.

Travis Griggs
"I think that we should be men first, and subjects afterward." -  
Henry David Thoreau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cairographics.org/archives/cairo/attachments/20070705/5eaf9402/attachment.htm 

More information about the cairo mailing list