Felix Meschberger wrote:
> 
> Another point is, that whenever a method is declared throws Exception I
> am force to catch(Exception), which is something a definitely do not
> like because I might want to let RuntimeException pass through.
> Otherwise I would also be required to declare throws Exception and may
> not even be able to describe what exact exception I am expected to
> throw ...
> 
While I usually tend to just throw Exception (as Bertrand does), this
usually creates nasty code for clients of the api. Imagine you implement
an interface from another api which has a method that declares to throw
exception A and B. Now in the implementation of the method you call the
ms api (ms = microsling :) ) which throws exception. So you have to test
if the ms api call throws exception A or B and pass this through or if
it is any other exception, you have to wrap it.
If the ms api just throws sling exception you catch it, wrap it and
that's it.

Carsten

-- 
Carsten Ziegeler
[EMAIL PROTECTED]

Reply via email to