Saturday, August 25, 2018

java - How to suppress Jersey exceptions that Jersey throws automatically?

I am using Jersey 1.14 for REST in JAVA. If there is any error in POST body of a resource, Jersey throws and exception which mentions my internal classes to client.
I continue wanting to give them error when the error is passed from my application, but suppress errors that are being thrown by Jersey(for the requests which does not even get to my application, as Jersey identifies the exception and throw it).
I searched for any flag to achieve this, but could not find anything. Is there a way to do this?



EDIT:
Rephrasing the question: mute/suppress error stack trace for invalid input in jersey



UPDATE:

I tried using ExceptionMapper, catching java.lang.Exception. It catches excpetion like when there is Content-Type missing, but fails to catch exception when there is an error in object conversion.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...