Class CatchAllExceptionMapper

  • All Implemented Interfaces:<Throwable>

    public class CatchAllExceptionMapper
    extends Object
    This mapper maps all Throwables to a suitable response.

    We don't want Jersey to re-throw anything to the HTTP container as this would result in logging the exception twice and possibly in interspersed illegible stack traces (see #484).

    2 additional aspects are handled: - Logging the exception. - Enriching the response with an error entity.

    • Constructor Detail

      • CatchAllExceptionMapper

        public CatchAllExceptionMapper()
    • Method Detail

      • toResponse

        public toResponse​(Throwable e)
        Specified by:
        toResponse in interface<Throwable>