users@jsr311.java.net

Handling of Checked Exception

From: Reto Bachmann-Gmür <reto_at_gmuer.ch>
Date: Tue, 11 Mar 2008 00:01:16 +0100

After reading the editors Note 2.1 (in section 2.2.3 of the january 31
draft) I was wondering why there isn't a mechanism to convert types of
(checked) exceptions to to WebApplicationsException (similar to the
conversion of java-objects to message bodies).

A use case would be various resource methods invoking methods on a
backend-proxy which may throw BackendOverloadedExceptionS, instead that
all resource methods catch this exception and throw a
WebApplicationException with a explanatory response body, a single
converter for BackendOverloadedException would be registered and the
resource methods would just propagate the checked Exception.

Reto