Hi

It really depends. I think it is perfectly fine for a service to define 
exceptions to be thrown in case of error. This may be checked exceptions (in 
the signature of the method) or unchecked exceptions (just listed in JavaDoc).

It really depends on the use case and requirements of the exposed API. At the 
end of the day, this is the same as plain Java: Your API and its contract 
define whether to throw exceptions and what exceptions to throw. Concentrate on 
the API to define this and don't care about higher level use of your API -- 
that would be none of the APIs business.

Regards
Felix

Am 28.05.2013 um 14:25 schrieb Robert A. Decker:

> Hello,
> 
> Generally, how do people handle exceptions in your exposed service methods? 
> Do you generally throw your own typed exceptions from the service method and 
> have the calling component handle the exception, even if its in a different 
> bundle? Or do you throw unhandled runtime exceptions from service methods and 
> have the called service method take care of its own errors?
> 
> Or a mix of the above? 
> 
> Rob

Reply via email to