Skip to content

Commit

Permalink
Simplify the "Payload is empty" handling code 2/2
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont committed Mar 13, 2015
1 parent 63f5e00 commit 5532aeb
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ public void createNumericMetric(@Suspended final AsyncResponse asyncResponse,
@Context UriInfo uriInfo
) {
if (metric == null) {
Response response = Response.status(Status.BAD_REQUEST)
.entity(new ApiError("Payload is empty"))
.type(APPLICATION_JSON_TYPE)
.build();
Response response = Response.status(Status.BAD_REQUEST).entity(new ApiError("Payload is empty")).build();
asyncResponse.resume(response);
return;
}
Expand Down

0 comments on commit 5532aeb

Please sign in to comment.