pub struct ProviderError {
pub kind: ProviderErrorKind,
pub message: String,
pub retry_after: Option<Duration>,
}Expand description
A failed run-time provider call. The message never contains credentials: response bodies are truncated and headers are never included.
Fields§
§kind: ProviderErrorKindClassification.
message: StringHuman-readable detail.
retry_after: Option<Duration>Server-provided Retry-After, honoured by the retry loop.
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn new(kind: ProviderErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: ProviderErrorKind, message: impl Into<String>) -> Self
Builds an error of kind.
Sourcepub fn with_retry_after(self, retry_after: Option<Duration>) -> Self
pub fn with_retry_after(self, retry_after: Option<Duration>) -> Self
Attaches a Retry-After hint.
Sourcepub fn rate_limited(message: impl Into<String>) -> Self
pub fn rate_limited(message: impl Into<String>) -> Self
Sourcepub fn platform_timeout(message: impl Into<String>) -> Self
pub fn platform_timeout(message: impl Into<String>) -> Self
Sourcepub fn kind_for_status(status: u16) -> ProviderErrorKind
pub fn kind_for_status(status: u16) -> ProviderErrorKind
Classifies an HTTP status of a provider API. Providers refine the
result with their own error codes (e.g. a 403 RESOURCE_EXHAUSTED is
Capacity).
Trait Implementations§
Source§impl Clone for ProviderError
impl Clone for ProviderError
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
impl Eq for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ProviderError> for DeployError
impl From<ProviderError> for DeployError
Source§fn from(error: ProviderError) -> Self
fn from(error: ProviderError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ProviderError
impl PartialEq for ProviderError
impl StructuralPartialEq for ProviderError
Auto Trait Implementations§
impl Forget for ProviderError
impl Freeze for ProviderError
impl Move for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnsafeUnpin for ProviderError
impl UnwindSafe for ProviderError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.