MCPcopy Create free account
hub / github.com/RipMeApp/ripme / response

Method response

src/main/java/com/rarchives/ripme/utils/Http.java:199–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 }
198
199 public Response response() throws IOException {
200 Response response;
201 IOException lastException = null;
202 int retries = this.retries;
203 while (--retries >= 0) {
204 try {
205 response = connection.execute();
206 return response;
207 } catch (IOException e) {
208 // Warn users about possibly fixable permission error
209 if (e instanceof org.jsoup.HttpStatusException) {
210 HttpStatusException ex = (HttpStatusException) e;
211
212 // These status codes might indicate missing cookies
213 // 401 Unauthorized
214 // 403 Forbidden
215
216 int status = ex.getStatusCode();
217 if (status == 401 || status == 403) {
218 throw new IOException("Failed to load " + url + ": Status Code " + status + ". You might be able to circumvent this error by setting cookies for this domain", e);
219 }
220 if (status == 404) {
221 throw new IOException("File not found " + url + ": Status Code " + status + ". ", e);
222 }
223 }
224
225 if (retrySleep > 0 && retries >= 0) {
226 logger.warn("Error while loading " + url + " waiting "+ retrySleep + " ms before retrying.", e);
227 Utils.sleep(retrySleep);
228 } else {
229 logger.warn("Error while loading " + url, e);
230 }
231 lastException = e;
232 }
233 }
234 throw new IOException("Failed to load " + url + " after " + this.retries + " attempts", lastException);
235 }
236
237 public static void SSLVerifyOff() {
238 try {

Callers 15

getMethod · 0.95
postMethod · 0.95
getJSONMethod · 0.95
getJSONArrayMethod · 0.95
handleJSONMethod · 0.80
getJsonPostsForOffsetMethod · 0.80
getFirstPageMethod · 0.80
downloadURLMethod · 0.80
getFirstPageMethod · 0.80
getFirstPageMethod · 0.80
getXAuthTokenMethod · 0.80
getDescriptionMethod · 0.80

Calls 1

sleepMethod · 0.95

Tested by

no test coverage detected