pub enum ApiError {
Status {
request: String,
status: u16,
message: String,
retry_after: Option<Duration>,
},
Transport {
request: String,
source: Error,
},
Timeout {
request: String,
budget: Duration,
},
TooLarge {
request: String,
cap: usize,
},
Malformed {
request: String,
source: Error,
},
Token(String),
JwtFile {
path: PathBuf,
source: Error,
},
Config(String),
}Expand description
A call that did not produce the answer it was asked for.
Variants§
Status
The control plane answered, and the answer was not a success.
Fields
Transport
The request never became a response: no route, refused, TLS, a reset.
Timeout
The call used up the budget it was given, across every attempt.
TooLarge
The body is larger than this server will hold in memory.
Malformed
The body arrived and is not what it should be.
Token(String)
A token could not be minted, so no call can be made at all.
JwtFile
The federated identity’s JWT could not be read from disk.
Config(String)
The client was built wrong. Never depends on the network, so it is worth telling apart from everything above.
Implementations§
Source§impl ApiError
impl ApiError
Sourcepub const fn status(&self) -> Option<u16>
pub const fn status(&self) -> Option<u16>
The status the control plane sent, where there was one.
The server crate turns this into the tool error’s status field, which
is the number a caller needs to look the failure up in Tailscale’s own
documentation.
Sourcepub const fn is_transient(&self) -> bool
pub const fn is_transient(&self) -> bool
Whether asking again could plausibly work.
This is about the failure, not about the request: whether this call
may be sent twice is Idempotence, and both have to agree before
anything is retried.
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()