I agree with the points in your wiki post. One thing I didn't exactly follow is what you want to do with the HttpStatusCodeException as that seems to fit into the contingency camp of exceptions. I think you want to make those extend IOException and thus not be a runtime exception? I am unsure about the parent class, but I do agree that probably should not be a Runtime exception since it is something that a program would care about.

-paddy

On Dec 29, 2007, at 11:58 AM, Felix Meschberger wrote:

Hi all,

Prompted by a blog by Alexander Klimetschek [1] and a very interesting
paper on exceptions [2] I set back to think about the exceptions in the
Sling API and wrote a wiki page on this subject [3].

To summarize, we should make the SlingException a RuntimeException and
all exceptions defined in the Sling API extend SlingException. Together with appropriate catching inside Sling itself (letting RuntimeExceptions
pass through generally) this should help us streamline exception
handling.

A prototype API definition may be found in the whiteboard at [4].

What do you think ?

Regards
Felix

[1]
http://weblogs.goshaky.com/weblogs/alexkli/entry/exception_best_practices
[2] http://dev2dev.bea.com/pub/a/2006/11/effective-exceptions.html
[3] http://cwiki.apache.org/SLING/effective-exceptions.html
[4]
http://svn.apache.org/repos/asf/incubator/sling/whiteboard/fmeschbe/effective_exceptions

Reply via email to