protected CompletionStage<Result> onDevServerError(Http.RequestHeader request,UsefulException exception){
  ObjectNode jsonError=Json.newObject();
  final Throwable cause=exception.cause;
  final String description=exception.description;
  final String id=exception.id;
  final String title=exception.title;
  jsonError.put("description",description);
  jsonError.put("title",title);
  jsonError.put("id",id);
  jsonError.put("message",exception.getMessage());
  jsonError.set("cause",causesToJson(cause));
  return CompletableFuture.completedFuture(Results.internalServerError(jsonError));
}

protected CompletionStage < Result > onDevServerError ( Http . RequestHeader request , UsefulException exception ) { ObjectNode jsonError = Json . newObject ( ) ; final Throwable cause = exception . cause ; final String description = exception . description ; final String id = exception . id ; final String title = exception . title ; jsonError . put ( "description" , description ) ; jsonError . put ( "title" , title ) ; jsonError . put ( "id" , id ) ; jsonError . put ( "message" , exception . getMessage ( ) ) ; jsonError . set ( "cause" , causesToJson ( cause ) ) ; return CompletableFuture . completedFuture ( Results . internalServerError ( jsonError ) ) ; }
invoked in dev mode when a server error occurs .
