Skip to content

Commit 044bd24

Browse files
committed
Ensure to try again if the connection failed.
1 parent 87f4dc7 commit 044bd24

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/scijava/io/http/HTTPHandle.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ else if (result.code() == 206) {
179179
serverCanResume = true;
180180
}
181181
else {
182-
throw new IOException("HTTP connection failure, errorcode: " + result
183-
.code());
182+
final int code = result.code();
183+
// We set this to null to ensure we will try again later
184+
this.result = null;
185+
throw new IOException("HTTP connection failure, errorcode: " + code);
184186
}
185187
}
186188
return result;

0 commit comments

Comments
 (0)