Skip to content

Commit

Permalink
Revert "changed getResponse for getting the http status code in Excep…
Browse files Browse the repository at this point in the history
…tion cloud-of-things#52"

This reverts commit 87fa685.
  • Loading branch information
jogehl committed Mar 14, 2018
1 parent 22d08e5 commit ac328c8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,12 @@ public String getResponse(String id, String api, String accept) {
if (response.isSuccessful()) {
result = response.body().string();
} else {
throw new CotSdkException(response.code(), "Error in request. id: " + id + ", api: " + api + ", accept: " + accept );
if (response.code() != HttpURLConnection.HTTP_NOT_FOUND) {
throw new CotSdkException(response.code(), "Error in request.");
}
}
return result;
} catch (CotSdkException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
throw new CotSdkException("Error in request", e);
} finally {
closeResponseBodyIfResponseAndBodyNotNull(response);
Expand Down

0 comments on commit ac328c8

Please sign in to comment.