mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Make RequestError::RetryAfter::0 u32, instead of i32
(you can't really wait a negative amount of time, can you?)
This commit is contained in:
parent
ac08117216
commit
51d6800a32
3 changed files with 6 additions and 2 deletions
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## unreleased
|
## unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `RequestError::RetryAfter` now has a `u32` field instead of `i32`
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- `UserId::{url, is_anonymous, is_channel, is_telegram}` convenience functions ([#197][pr197])
|
- `UserId::{url, is_anonymous, is_channel, is_telegram}` convenience functions ([#197][pr197])
|
||||||
|
|
|
@ -31,7 +31,7 @@ pub enum RequestError {
|
||||||
/// In case of exceeding flood control, the number of seconds left to wait
|
/// In case of exceeding flood control, the number of seconds left to wait
|
||||||
/// before the request can be repeated.
|
/// before the request can be repeated.
|
||||||
#[error("Retry after {0} seconds")]
|
#[error("Retry after {0} seconds")]
|
||||||
RetryAfter(i32),
|
RetryAfter(u32),
|
||||||
|
|
||||||
/// Network error while sending a request to Telegram.
|
/// Network error while sending a request to Telegram.
|
||||||
#[error("A network error: {0}")]
|
#[error("A network error: {0}")]
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub enum ResponseParameters {
|
||||||
|
|
||||||
/// In case of exceeding flood control, the number of seconds left to wait
|
/// In case of exceeding flood control, the number of seconds left to wait
|
||||||
/// before the request can be repeated.
|
/// before the request can be repeated.
|
||||||
RetryAfter(i32),
|
RetryAfter(u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Reference in a new issue