[cairo] Idle thoughts on error propagation
behdad at behdad.org
Thu May 1 15:14:35 PDT 2008
On Thu, 2008-05-01 at 15:13 -0700, Carl Worth wrote:
> I can imagine a case where this could be wrong.
> The cairo_t context is conceptually transient for what could be a
> long-standing surface. For example, if I had an application creating a
> new context for the same surface on every expose event, would it be
> correct to force the surface to shutdown due to an error on the
My answer to that is "Yes. A single error means that the surface does
not contain the drawing that it's expected to have, so it should be in
an error state."
Your concern is not limited to this case though. Same applied to the
case of one error shutting down the context. Imagine a similar case,
but one context is used for all drawing. How's that different? And
indeed it has been a problem. One faulty PDF font causing no drawing...
The solution has been to fix bogus errors such that only unavoidable and
programmer errors cause retained error status.
"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