public abstract class RateLimitHandler
extends java.lang.Object
GitHubBuilder.withRateLimitHandler(RateLimitHandler)
,
AbuseLimitHandler
Modifier and Type | Field and Description |
---|---|
static RateLimitHandler |
FAIL
Fail immediately.
|
static RateLimitHandler |
WAIT
Block until the API rate limit is reset.
|
Constructor and Description |
---|
RateLimitHandler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
onError(java.io.IOException e,
java.net.HttpURLConnection uc)
Called when the library encounters HTTP error indicating that the API rate limit is reached.
|
public static final RateLimitHandler WAIT
public static final RateLimitHandler FAIL
public abstract void onError(java.io.IOException e, java.net.HttpURLConnection uc) throws java.io.IOException
Any exception thrown from this method will cause the request to fail, and the caller of github-api will receive an exception. If this method returns normally, another request will be attempted. For that to make sense, the implementation needs to wait for some time.
e
- Exception from Java I/O layer. If you decide to fail the processing, you can throw
this exception (or wrap this exception into another exception and throw it.)uc
- Connection that resulted in an error. Useful for accessing other response headers.java.io.IOException
Copyright © 2016. All Rights Reserved.