mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
java client: fail a chunk fetch that answers a non-2xx status
doFetchOneFullChunkData returned the response body whatever the status, so a 401 "wrong jwt" or a 404 JSON error was taken as chunk data and cached. Throw instead, so the fetch tries the next location and reports the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f5f71577e
commit
6d68381ea4
1 file changed
+5
@@ -189,6 +189,11 @@ public class SeaweedRead {
|
||||
CloseableHttpResponse response = SeaweedUtil.getClosableHttpClient().execute(request);
|
||||
|
||||
try {
|
||||
int status = response.getStatusLine().getStatusCode();
|
||||
if (status / 100 != 2) {
|
||||
throw new IOException("fetch " + url + ": " + response.getStatusLine());
|
||||
}
|
||||
|
||||
HttpEntity entity = response.getEntity();
|
||||
|
||||
Header contentEncodingHeader = entity.getContentEncoding();
|
||||
|
||||
Reference in new issue
Block a user