View Source Tw.V1_1.TwitterAPIError exception (Tw v0.1.1)
Exception
which wraps an error response from Twitter API.
See the Twitter API documentation for details.
Link to this section Summary
Link to this section Types
Specs
t() :: %Tw.V1_1.TwitterAPIError{ __exception__: true, errors: [%{message: binary(), code: pos_integer()}], message: binary(), response: Tw.HTTP.Response.t() }
Link to this section Functions
Specs
Specs
Specs
Specs
rate_limit_reset_at(t()) :: DateTime.t() | nil
Return DateTime
when the rate limit is reset.
If the given error is not related to rate limiting, return nil
.
Link to this function
rate_limit_reset_in(error, base_fn \\ fn -> DateTime.utc_now() |> DateTime.to_unix(:second) end)
View SourceReturn time until rate limit is reset in milliseconds.
If the given error is not related to rate limiting, return nil
.
Examples
TwitterAPIError.rate_limit_reset_in(error)
|> Process.sleep()