Fix imagestash, better exception logging on HTTP failures
This commit is contained in:
parent
1b9eea8499
commit
cdaa3b26d1
@ -73,7 +73,7 @@ public class ImagestashRipper extends AbstractJSONRipper {
|
||||
JSONObject image = images.getJSONObject(i);
|
||||
String imageURL = image.getString("src");
|
||||
if (imageURL.startsWith("/")) {
|
||||
imageURL = "http://imagestash.org" + imageURL;
|
||||
imageURL = "https://imagestash.org" + imageURL;
|
||||
}
|
||||
imageURLs.add(imageURL);
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ public class Http {
|
||||
|
||||
public Response response() throws IOException {
|
||||
Response response = null;
|
||||
IOException lastException = null;
|
||||
int retries = this.retries;
|
||||
while (--retries >= 0) {
|
||||
try {
|
||||
@ -130,9 +131,10 @@ public class Http {
|
||||
return response;
|
||||
} catch (IOException e) {
|
||||
logger.warn("Error while loading " + url, e);
|
||||
lastException = e;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
throw new IOException("Failed to load " + url + " after " + this.retries + " attempts");
|
||||
throw new IOException("Failed to load " + url + " after " + this.retries + " attempts", lastException);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user