diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/io/http/ning/NingHttpClient.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/io/http/ning/NingHttpClient.java index 41c4bc73f3..e9d7f5f789 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/io/http/ning/NingHttpClient.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/io/http/ning/NingHttpClient.java @@ -52,11 +52,16 @@ public class NingHttpClient implements NingHttpClientFacade { @Override public byte[] onCompleted( Response response - ) throws IOException { + ) throws Exception { + int statusCode = response.getStatusCode(); + if (statusCode >= 400) { + throw new Exception("got status " + statusCode + + " fetching " + url); + } byte[] ret = bytes.toByteArray(); bytes.close(); log.info( - response.getStatusCode() + statusCode + " " + response.getStatusText() + " ("