[cairo] error handling questions

Travis Griggs tgriggs at cincom.com
Mon Jul 16 09:26:10 PDT 2007


On Jul 9, 2007, at 3:27, Andy Wingo wrote:

> Hi Travis,
>
> On Thu, 2007-07-05 at 09:29 -0700, Travis Griggs wrote:
>
>> For the Smalltalk case, what I could see doing is watching my own
>> stderr and picking off cairo errors.
>
> Why are you doing this? This is most terrible.

I agree completely. I think you misunderstand what I want to do. Read  
on...

>
>> My goal basically is to create/throw an exception when a Cairo error
>> occurs, with as much meaningful information packed into it.
>
> So check the cairo_status_t at the return of every function, and raise
> an exception if it is not OK.

We do exactly this. Not only do we raise an error, but we raise it  
with information garnered from the error code. And in Smalltalk, this  
can--when configured one particular way--result in an immediate  
visual exception window which can be used to jump immediately to the  
debugger. As it stands right now, since any GDI specific error is  
flattened into OOM error, the only information seen in the error  
notifier is that the Cairo binding is out of memory. Which is  
completely fallacious. And makes application programmers wonder why  
the system is running out of memory when in fact it's just fine, but  
rather, buried somewhere in the bowels of stderr is the real truth  
that win32 clipping is frelled, or some other such error.

--
Travis Griggs
Objologist
"You A students, you'll be back soon teaching here with me. You B  
students, you'll actually go on to be real engineers. You C students,  
you'll go into management and tell the A and B students what to do."  
- My Fluid Dynamics Professor whom I have yet to disprove


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20070716/fee9951f/attachment.htm 


More information about the cairo mailing list