Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
199 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 19 additions & 21 deletions
40
src/main/java/pl/jpetryk/redditbot/exceptions/TwitterApiException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
package pl.jpetryk.redditbot.exceptions; | ||
|
||
import twitter4j.TwitterException; | ||
|
||
/** | ||
* Created by Jan on 09/01/15. | ||
*/ | ||
public class TwitterApiException extends Exception { | ||
public class TwitterApiException extends RuntimeException { | ||
|
||
public TwitterApiException(Throwable cause, boolean rateLimitExceeded, long miliSecondsUntilReset, int errorCode) { | ||
super(cause); | ||
this.miliSecondsUntilReset = miliSecondsUntilReset; | ||
this.rateLimitExceeded = rateLimitExceeded; | ||
this.errorCode = errorCode; | ||
} | ||
public TwitterApiException(Throwable cause, boolean rateLimitExceeded, long miliSecondsUntilReset, int errorCode) { | ||
super(cause); | ||
this.miliSecondsUntilReset = miliSecondsUntilReset; | ||
this.rateLimitExceeded = rateLimitExceeded; | ||
this.errorCode = errorCode; | ||
} | ||
|
||
private boolean rateLimitExceeded; | ||
private boolean rateLimitExceeded; | ||
|
||
private long miliSecondsUntilReset; | ||
private long miliSecondsUntilReset; | ||
|
||
private int errorCode; | ||
private int errorCode; | ||
|
||
public boolean isRateLimitExceeded() { | ||
return rateLimitExceeded; | ||
} | ||
public boolean isRateLimitExceeded() { | ||
return rateLimitExceeded; | ||
} | ||
|
||
public long getMiliSecondsUntilReset() { | ||
return miliSecondsUntilReset; | ||
} | ||
public long getMiliSecondsUntilReset() { | ||
return miliSecondsUntilReset; | ||
} | ||
|
||
public int getErrorCode() { | ||
return errorCode; | ||
} | ||
public int getErrorCode() { | ||
return errorCode; | ||
} | ||
} |
Oops, something went wrong.