Class ExceptionHandler

  • All Implemented Interfaces:
    javax.ws.rs.ext.ExceptionMapper<Throwable>

    @Provider
    public class ExceptionHandler
    extends Object
    implements javax.ws.rs.ext.ExceptionMapper<Throwable>
    Translates any Throwable to a HTTP 500 error and a JSON response. Response content format: {"type" : "ExceptionType", "message" : "some exception message"}
    Author:
    nico.rehwaldt
    • Constructor Detail

      • ExceptionHandler

        public ExceptionHandler()
    • Method Detail

      • toResponse

        public javax.ws.rs.core.Response toResponse​(Throwable throwable)
        Specified by:
        toResponse in interface javax.ws.rs.ext.ExceptionMapper<Throwable>