dfx-core 0.3.0

dfx core library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use reqwest::StatusCode;

pub fn is_retryable(err: &reqwest::Error) -> bool {
    err.is_timeout()
        || err.is_connect()
        || matches!(
            err.status(),
            Some(
                StatusCode::INTERNAL_SERVER_ERROR
                    | StatusCode::BAD_GATEWAY
                    | StatusCode::SERVICE_UNAVAILABLE
                    | StatusCode::GATEWAY_TIMEOUT
                    | StatusCode::TOO_MANY_REQUESTS
            )
        )
}