Details
Description
To test my backoff logic I need to be able to create and throw
TwitterExceptions. However, now I can only create one that represents
a rate limit exception if I create a HttpResponse object which seems
very complicated. In 2.1.1. there was a static create with retry after
method which was perfect but that has been removed.
The simplest solution for me would be to have an interface I could
just mock out. Another option would be to allow easy creation of new
exceptions with raw values for retry after and error code or to allow
those values to be set directly via a setter.
TwitterExceptions. However, now I can only create one that represents
a rate limit exception if I create a HttpResponse object which seems
very complicated. In 2.1.1. there was a static create with retry after
method which was perfect but that has been removed.
The simplest solution for me would be to have an interface I could
just mock out. Another option would be to allow easy creation of new
exceptions with raw values for retry after and error code or to allow
those values to be set directly via a setter.
public TwitterException(String message, int retryAfter
, Map<String, List<String>> responseHeaderFields
, int statusCode, RateLimitStatus rateLimitStatus
, RateLimitStatus featureSpecificLateLimitStatus)