Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
Signed-off-by: yichen88 <[email protected]>
  • Loading branch information
yichen88 committed Jun 16, 2020
1 parent 2089183 commit 62f3203
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public static <T> T readEntityIfOk(Response response, GenericType<T> entityType)

public static <T> Optional<T> readOptionalEntityIfOk(Response response, Class<T> entityType) {
Response.Status status = Response.Status.fromStatusCode(response.getStatus());
// the NO_CONTENT case is for backwards compatibility.
// The remote AppStorageServer may still runs on an old version which response with 204 if it not found resources.
if (status == Response.Status.NO_CONTENT || status == Response.Status.NOT_FOUND) {
LOGGER.trace(" --> null");
return Optional.empty();
Expand Down

0 comments on commit 62f3203

Please sign in to comment.