users@jersey.java.net

[Jersey] Avoiding HTML response on unexpected exceptions

From: Gustavo Garcia <ggb_at_tokbox.com>
Date: Mon, 30 Jun 2014 22:52:03 -0700

What is the best way to avoid jersey returning a HTML response with the
error when an unexpected exception happens (i.e NullPointerException) ?

I tried creating a ExceptionMapper for Exception and it works but it means
that I loose the default exception mapping for
javax.ws.rs.WebApplicationException exceptions that is also quite bad.

What are the best practices here?

Thx a lot