class Router {

  @ExceptionHandler(value = { Throwable.class })
  @ResponseStatus(INTERNAL_SERVER_ERROR)
  @ResponseBody
  protected Object handleThrowable(Throwable ex, WebRequest request) {
    logger.warn("Unexpected exception:", ex);
    return new ServiceError(ex.getMessage(), getStackTraceOf(ex));
  }

}