Skip to content

Commit

Permalink
Fixed Failed Response code for issue #874.
Browse files Browse the repository at this point in the history
Signed-off-by: mallikagogoi7 <[email protected]>
  • Loading branch information
mallikagogoi7 committed Aug 21, 2023
1 parent a5c0ad8 commit e0b7f0f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class FailedHttpResponseInterceptor implements HttpResponseInterceptor {

public static final int ERROR_CODE_501 = 501;

public static final int ERROR_CODE_403 = 403;

private final String url;

public FailedHttpResponseInterceptor(final String url){
Expand All @@ -32,6 +34,7 @@ public void process(HttpResponse response, EntityDetails entity, HttpContext con
if (response.getCode() == ERROR_CODE_500 ||
response.getCode() == ERROR_CODE_400 ||
response.getCode() == ERROR_CODE_404 ||
response.getCode() == ERROR_CODE_403 ||
response.getCode() == ERROR_CODE_501) {
throw new IOException(String.format("url: %s , status code: %s", url,response.getCode()));
}
Expand Down

0 comments on commit e0b7f0f

Please sign in to comment.