[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] Error module: first lines
From: |
gerel |
Subject: |
Re: [pdf-devel] Error module: first lines |
Date: |
Mon, 17 Dec 2007 14:25:12 -0300 |
> From: Behdad Esfahbod <address@hidden> Are you proposing these as part of
> the error handling scheme for the library? If yes, I'm strongly against
> them. Libraries should:
>
> - Be re-entrant. That means, a global total-number-of-errors is useless.
I agree.
> - Not write anything on stdout/stderr unless explicitly asked to. (this
> can be relaxed to "Not write anything... if explicitly asked to", but I
> prefer the former)
>
Sure.
> - Not terminate the process unless explicitly asked to. That means, no
> abort on bad input. No asserts as much as possible. Debug builds are an
> exception.
>
The current API doesn't abort the process unless you tell it to, by giving the
"status" variable a value different than 0.
> - Be painlessly usable by multiple users in the same process. That means,
> things like "context" objects should be used that encapsulate everything a
> user of the library needs, and allow for multiple contexts to co-exists.
> This essentially requires all the above, no global total-number-of-errors, no
> unwanted printout, and definitely no termination.
>
> I highly recommend the error-reporting scheme used in cairo. The way it
> works is that each object retains its own error status (the error code of the
> first encountered error in fact) and ignores any subsequent requests to the
> object. Errors are propagated from object to object, and can be queried for
> by the user. This lends itself quite well to language bindings that want to
> throw exceptions for example, and is comfortable to use from C too, as you
> can simply draw whatever you want (make as many function calls as you want)
> and only query for error at the end.
>
Can we write that scheme on top of the current API ?
Thank for your comments behdad.
-gerel
- [pdf-devel] Error module: first lines, gerel, 2007/12/15
- [pdf-devel] Error module: first lines, gerel, 2007/12/15
- Re: [pdf-devel] Error module: first lines, Behdad Esfahbod, 2007/12/16
- Re: [pdf-devel] Error module: first lines,
gerel <=
- Re: [pdf-devel] Error module: first lines, jemarch, 2007/12/17
- Re: [pdf-devel] Error module: first lines, gerel, 2007/12/17
- Re: [pdf-devel] Error module: first lines, Behdad Esfahbod, 2007/12/17
- Re: [pdf-devel] Error module: first lines, gerel, 2007/12/18
- Re: [pdf-devel] Error module: first lines, Behdad Esfahbod, 2007/12/18
- Re: [pdf-devel] Error module: first lines, jemarch, 2007/12/19