Skip to content

Commit

Permalink
Return null on GET 404
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed Oct 19, 2016
1 parent 9775a7a commit b6ea865
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public PagedList() {
*/
public PagedList(Page<E> page) {
this();
if (page == null) {
return;
}
List<E> retrievedItems = page.getItems();
if (retrievedItems != null) {
items.addAll(retrievedItems);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public ServiceResponse<T> build(Response<ResponseBody> response) throws E, IOExc
return new ServiceResponse<>((T) buildBody(statusCode, responseBody), response);
} else if (response.isSuccessful() && responseTypes.size() == 1) {
return new ServiceResponse<>((T) buildBody(statusCode, responseBody), response);
} else if ("GET".equals(response.raw().request().method()) && statusCode == 404) {
return new ServiceResponse<>(null, response);
} else {
try {
String responseContent = responseBody.string();
Expand Down

0 comments on commit b6ea865

Please sign in to comment.