Class ExceptionHandler

  • All Implemented Interfaces:<java.lang.Throwable>

    public class ExceptionHandler
    extends java.lang.Object
    Translates any Throwable to a HTTP 500 error and a JSON response. Response content format: {"type" : "ExceptionType", "message" : "some exception message"}
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description toResponse​(java.lang.Throwable throwable)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionHandler

        public ExceptionHandler()
    • Method Detail

      • toResponse

        public toResponse​(java.lang.Throwable throwable)
        Specified by:
        toResponse in interface<java.lang.Throwable>