Hi Gabo

Hi Sergey,

Thanks for pointing me in the right direction. I got most of what I need from 
this site:

http://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS

One last thing though, is it possible to remove the <Result> tags?

I'm not sure which <Result> tag you're referring to - I couldn't find any 
references on the wiki.


> Can you explain a bit more what exactly you're trying to do ?

To answer your question, the application is meant to suppress all RuntimeException with a more friendly message and forward that exception and the stacktrace to me. Also, to replace the error message to 400 instead of 500 for the checked exceptions.

Also, I am not sure where in the documentation it could be found, but I wasn't able to find how the mapper would be applied to the endpoint. I tried adding it as a provider and it worked. Not sure if this is the proper way, or I'm just lucky it worked.

Yea, it's just a provider. All the JAXRS providers (body readers/writers, exception mappers, context resolvers) plus CXF extensions like request/response filters and ParameterResolvers can be registered as jaxrs:server/jaxrs:providers/ provider beans... By the way one can have unique provider instances (with the unique configuration) per endpoint if needed. For ex, you can control multipart thresholds and temp dirs per endpoint by configuring the ActivationProvider accordingly

Cheers, Sergey


Again, my thanks.

Gabo

Sergey Beryozkin wrote:
Hi Gabo

Can you explain a bit more what exactly you're trying to do ?
I think if you have a JAXRS ExceptionMapper for say CustomException which does extend RuntimeException then you'll know in this mapper's implementation what sort of exception it is...

But may be I'm missing something...

Cheers, Sergey


----- Original Message ----- From: "Gabo Manuel" <kman...@solegysystems.com>
To: <users@cxf.apache.org>
Sent: Thursday, February 12, 2009 10:11 AM
Subject: [JAX-RS] Fault handling


Hi All,

I was just wondering if there is a possibility to acquire the actual Exception object, and maybe even replace it with another Exception through interceptors.

I was already able to change the response code (400 or 500) depending on whether the exception was a checked exception or not. I would however, prefer to be able to automatically notify some people for the unchecked exceptions. I tried printing all of the available content formats (message.getContentFormats()) to no avail.

Again, thanks in advance.

Gabo
------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.0.234 / Virus Database: 270.10.23/1947 
- Release Date: 02/11/09 18:11:00



Reply via email to