Skip to content

Commit

Permalink
re-add client error when resources are not accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueldima committed Nov 30, 2020
1 parent 0e77aa9 commit aad978c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public static LinkInfo getLinkData(CloseableHttpClient client, String originalUr
throw new LinkException(LinkException.Kind.DATA_STREAM_ERROR, "" + linkInfo.downloadLink, xc);
}

int status = response.getStatusLine().getStatusCode();
if (status >= 400) {
throw new LinkException(LinkException.Kind.STATUS_ERROR, "" + linkInfo.downloadLink, status);
}

switch (context.getCacheResponseStatus()) {
case CACHE_HIT:
LOGGER.debug("A response was generated from the cache with no requests sent upstream");
Expand Down

0 comments on commit aad978c

Please sign in to comment.