fixed missing return error
This commit is contained in:
parent
add7f5ece2
commit
9b6da7080b
|
@ -167,8 +167,7 @@ public class TelegramAPI implements Runnable {
|
||||||
|
|
||||||
//catch 429 too many error
|
//catch 429 too many error
|
||||||
if (response == 429) {
|
if (response == 429) {
|
||||||
toomany = true;
|
if(trycount < 10) toomany = true;
|
||||||
if(trycount > 10) break;
|
|
||||||
|
|
||||||
//try to read timeout
|
//try to read timeout
|
||||||
//too Many Requests: retry after 19
|
//too Many Requests: retry after 19
|
||||||
|
@ -182,13 +181,16 @@ public class TelegramAPI implements Runnable {
|
||||||
System.out.println("Got 429 -> sleep for " + timeout + " seconds");
|
System.out.println("Got 429 -> sleep for " + timeout + " seconds");
|
||||||
Thread.sleep(timeout * 1000);
|
Thread.sleep(timeout * 1000);
|
||||||
} catch(InterruptedException e) {}
|
} catch(InterruptedException e) {}
|
||||||
continue;
|
|
||||||
|
if(trycount < 10) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new APIError(parameter, request, con.getResponseCode(), null, errdesc);
|
throw new APIError(parameter, request, con.getResponseCode(), null, errdesc);
|
||||||
//throw new IOException("API request returned HTTP " + con.getResponseCode() + " (" + con.getResponseMessage() + ") for action " + request + "\nurl: " + url.toString() + "\nparams: " + parameter + "\nerror description: " + errdesc);
|
//throw new IOException("API request returned HTTP " + con.getResponseCode() + " (" + con.getResponseMessage() + ") for action " + request + "\nurl: " + url.toString() + "\nparams: " + parameter + "\nerror description: " + errdesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//unreachable code?
|
||||||
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String readfromIS(InputStream is) {
|
protected String readfromIS(InputStream is) {
|
||||||
|
|
Loading…
Reference in New Issue