The ExceptionMapper implementation works fine for the exceptions thrown at controller level of my code. However there are some authentication filter being executed before and after the api call. Exception thrown at filter level is not being mapped by the ExceptionMapper.
Due to this my UI response has complete stack trace of the exception.
Hence there could be two solutions:
1. If there is any configuration so that exception thrown at filter level can be mapped by exception mapper
2. Is there any graceful way to remove stack trace when exception is thrown at filter level.
Using RestEasy 3.6.2 and Google Guice as DI framework.
public class MyExceptionMapper implements ExceptionMapper<Throwable>
//implementation for mapper