Skip to content

Commit

Permalink
#6 Fix error format
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jan 16, 2017
1 parent f5c23dc commit 6951afa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/org/elastic4play/ErrorHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ErrorHandler extends HttpErrorHandler {
def toResult[C](status: Int, c: C)(implicit writeable: Writeable[C]) = Result(header = ResponseHeader(status), body = writeable.toEntity(c))

def onServerError(request: RequestHeader, exception: Throwable) = {
val (status, body) = toErrorResult(exception).getOrElse(Status.INTERNAL_SERVER_ERROR Json.obj("type" exception.getClass.getName, "error" exception.getMessage))
val (status, body) = toErrorResult(exception).getOrElse(Status.INTERNAL_SERVER_ERROR Json.obj("type" exception.getClass.getName, "message" exception.getMessage))
Logger.info(s"${request.method} ${request.uri} returned ${status}", exception)
Future.successful(toResult(status, body))
}
Expand Down

0 comments on commit 6951afa

Please sign in to comment.