Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21644#discussion_r198558986
--- Diff:
core/src/main/scala/org/apache/spark/status/api/v1/ApiRootResource.scala ---
@@ -148,38 +148,21 @@ private[v1] trait BaseAppResource extends
ApiRequestContext {
}
private[v1] class ForbiddenException(msg: String) extends
WebApplicationException(
- Response.status(Response.Status.FORBIDDEN).entity(msg).build())
+ UIUtils.buildErrorResponse(Response.Status.FORBIDDEN, msg))
private[v1] class NotFoundException(msg: String) extends
WebApplicationException(
- new NoSuchElementException(msg),
- Response
- .status(Response.Status.NOT_FOUND)
- .entity(ErrorWrapper(msg))
- .build()
-)
+ new NoSuchElementException(msg),
+ UIUtils.buildErrorResponse(Response.Status.NOT_FOUND, msg))
private[v1] class ServiceUnavailable(msg: String) extends
WebApplicationException(
- new ServiceUnavailableException(msg),
- Response
- .status(Response.Status.SERVICE_UNAVAILABLE)
- .entity(ErrorWrapper(msg))
- .build()
-)
+ new ServiceUnavailableException(msg),
--- End diff --
Hmm, if that's the case then probably the wrappers can save some code
(since they abstract the building of the response)...
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]