#[non_exhaustive]pub enum Error {
Transport(String),
TokenRefresh(TokenCacheError),
InvalidPathPrefix {
prefix: String,
reason: String,
},
Rejected {
code: Code,
message: String,
},
ServerError {
code: Code,
message: String,
},
ProtoMismatch(String),
}Expand description
All errors returned by crate::PcsExternalClient methods.
The three Grpc* variants mirror PasFailure semantics — Rejected
means the call reached PCS and was turned down at the application layer
(don’t retry as-is), ServerError is a 5xx-class state (retry-eligible),
Transport means the call never reached PCS.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(String)
Connection, TLS, or network-level failure.
TokenRefresh(TokenCacheError)
Bearer token acquisition failed before the gRPC call could be made.
InvalidPathPrefix
The configured path prefix is malformed — caught at build time.
Rejected
PCS returned a non-OK gRPC status at the application layer
(InvalidArgument, NotFound, PermissionDenied, Unauthenticated,
ResourceExhausted, FailedPrecondition, AlreadyExists,
OutOfRange, Aborted, Cancelled).
Caller’s input, auth, or state is bad — do not retry as-is.
ServerError
PCS returned a 5xx-class status (Internal, Unknown, DataLoss,
Unimplemented, DeadlineExceeded). Retry-eligible.
ProtoMismatch(String)
A required proto field was absent or could not be mapped to a domain type.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<TokenCacheError> for Error
impl From<TokenCacheError> for Error
Source§fn from(source: TokenCacheError) -> Self
fn from(source: TokenCacheError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.