MCPcopy Create free account
hub / github.com/Botloader/botloader / from

Method from

components/discordoauthwrapper/src/twilight_client.rs:187–199  ·  view source on GitHub ↗
(te: twilight_http::Error)

Source from the content-addressed store, hash-verified

185
186impl From<twilight_http::Error> for RequestError {
187 fn from(te: twilight_http::Error) -> Self {
188 use twilight_http::error::ErrorType as TwilightErrorType;
189
190 match te.kind() {
191 TwilightErrorType::Response { status, .. } if status.get() == 401 => Self::InvalidToken,
192 TwilightErrorType::Unauthorized => Self::InvalidToken,
193 TwilightErrorType::Response {
194 error: ApiError::Ratelimited(RatelimitedApiError { retry_after, .. }),
195 ..
196 } => Self::Ratelimit(Duration::from_millis(*retry_after as u64)),
197 _ => Self::Other(te),
198 }
199 }
200}

Callers

nothing calls this directly

Calls 2

kindMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected