Enum AuthError
#[non_exhaustive]pub enum AuthError {
Show 18 variants
Request(RequestError),
AccessDenied(AccessDenied),
InvalidGrant(InvalidGrant),
InvalidClient(InvalidClient),
InvalidUrl(InvalidUrl),
Region(UnsupportedRegion),
InvalidCrn(InvalidCrn),
WorkspaceMismatch(WorkspaceMismatch),
InvalidWorkspaceId(InvalidWorkspaceId),
MissingWorkspaceCrn(MissingWorkspaceCrn),
NotAuthenticated(NotAuthenticated),
TokenExpired(TokenExpired),
InvalidAccessKey(InvalidAccessKeyError),
InvalidToken(InvalidToken),
Server(ServerError),
AlreadyConsumed(AlreadyConsumed),
Internal(InternalError),
Store(StoreError),
}Expand description
Errors that can occur during an authentication flow.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Request(RequestError)
AccessDenied(AccessDenied)
InvalidGrant(InvalidGrant)
InvalidClient(InvalidClient)
InvalidUrl(InvalidUrl)
Region(UnsupportedRegion)
InvalidCrn(InvalidCrn)
WorkspaceMismatch(WorkspaceMismatch)
InvalidWorkspaceId(InvalidWorkspaceId)
MissingWorkspaceCrn(MissingWorkspaceCrn)
NotAuthenticated(NotAuthenticated)
TokenExpired(TokenExpired)
InvalidAccessKey(InvalidAccessKeyError)
InvalidToken(InvalidToken)
Server(ServerError)
AlreadyConsumed(AlreadyConsumed)
Internal(InternalError)
Store(StoreError)
Implementations§
Source§impl AuthError
impl AuthError
Sourcepub const ERROR_CODES: &'static [&'static str]
pub const ERROR_CODES: &'static [&'static str]
The complete set of codes AuthError::error_code can return — the
stable, machine-readable contract surfaced across FFI (JS Error.code,
Node-API codes, the index.d.ts / wasm-inline.d.ts AuthFailure
unions). The bindings derive their expected union from this constant
rather than re-scraping the per-error AuthErrorKind::error_code impls,
and auth_error_code_is_stable_for_every_variant pins that it stays in
lockstep with what error_code actually returns.
Sourcepub fn error_code(&self) -> &'static str
pub fn error_code(&self) -> &'static str
Stable machine-readable identifier for surfacing across FFI boundaries
(e.g. JS Error.code, Node-API error codes). Delegates to the wrapped
error’s AuthErrorKind::error_code; every value it can return is
listed in AuthError::ERROR_CODES.
Trait Implementations§
Source§impl Diagnostic for AuthError
impl Diagnostic for AuthError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeSource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Diagnostics.Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Error for AuthError
impl Error for AuthError
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<AccessDenied> for AuthError
impl From<AccessDenied> for AuthError
Source§fn from(source: AccessDenied) -> AuthError
fn from(source: AccessDenied) -> AuthError
Source§impl From<AlreadyConsumed> for AuthError
impl From<AlreadyConsumed> for AuthError
Source§fn from(source: AlreadyConsumed) -> AuthError
fn from(source: AlreadyConsumed) -> AuthError
§impl From<AuthError> for CtsClientError
impl From<AuthError> for CtsClientError
§impl From<AuthError> for ZeroKMSBuilderError
impl From<AuthError> for ZeroKMSBuilderError
Source§impl From<DeviceClientError> for AuthError
Available on non-WebAssembly only.
impl From<DeviceClientError> for AuthError
Source§fn from(e: DeviceClientError) -> AuthError
fn from(e: DeviceClientError) -> AuthError
Source§impl From<Infallible> for AuthError
impl From<Infallible> for AuthError
Source§fn from(never: Infallible) -> AuthError
fn from(never: Infallible) -> AuthError
Source§impl From<InternalError> for AuthError
impl From<InternalError> for AuthError
Source§fn from(source: InternalError) -> AuthError
fn from(source: InternalError) -> AuthError
Source§impl From<InvalidAccessKey> for AuthError
impl From<InvalidAccessKey> for AuthError
Source§fn from(e: InvalidAccessKey) -> AuthError
fn from(e: InvalidAccessKey) -> AuthError
Source§impl From<InvalidAccessKeyError> for AuthError
impl From<InvalidAccessKeyError> for AuthError
Source§fn from(source: InvalidAccessKeyError) -> AuthError
fn from(source: InvalidAccessKeyError) -> AuthError
Source§impl From<InvalidClient> for AuthError
impl From<InvalidClient> for AuthError
Source§fn from(source: InvalidClient) -> AuthError
fn from(source: InvalidClient) -> AuthError
Source§impl From<InvalidCrn> for AuthError
impl From<InvalidCrn> for AuthError
Source§fn from(source: InvalidCrn) -> AuthError
fn from(source: InvalidCrn) -> AuthError
Source§impl From<InvalidCrn> for AuthError
impl From<InvalidCrn> for AuthError
Source§fn from(e: InvalidCrn) -> AuthError
fn from(e: InvalidCrn) -> AuthError
Source§impl From<InvalidGrant> for AuthError
impl From<InvalidGrant> for AuthError
Source§fn from(source: InvalidGrant) -> AuthError
fn from(source: InvalidGrant) -> AuthError
Source§impl From<InvalidToken> for AuthError
impl From<InvalidToken> for AuthError
Source§fn from(source: InvalidToken) -> AuthError
fn from(source: InvalidToken) -> AuthError
Source§impl From<InvalidUrl> for AuthError
impl From<InvalidUrl> for AuthError
Source§fn from(source: InvalidUrl) -> AuthError
fn from(source: InvalidUrl) -> AuthError
Source§impl From<InvalidWorkspaceId> for AuthError
impl From<InvalidWorkspaceId> for AuthError
Source§fn from(source: InvalidWorkspaceId) -> AuthError
fn from(source: InvalidWorkspaceId) -> AuthError
Source§impl From<InvalidWorkspaceId> for AuthError
impl From<InvalidWorkspaceId> for AuthError
Source§fn from(e: InvalidWorkspaceId) -> AuthError
fn from(e: InvalidWorkspaceId) -> AuthError
Source§impl From<MissingWorkspaceCrn> for AuthError
impl From<MissingWorkspaceCrn> for AuthError
Source§fn from(source: MissingWorkspaceCrn) -> AuthError
fn from(source: MissingWorkspaceCrn) -> AuthError
Source§impl From<NotAuthenticated> for AuthError
impl From<NotAuthenticated> for AuthError
Source§fn from(source: NotAuthenticated) -> AuthError
fn from(source: NotAuthenticated) -> AuthError
Source§impl From<ParseError> for AuthError
impl From<ParseError> for AuthError
Source§fn from(e: ParseError) -> AuthError
fn from(e: ParseError) -> AuthError
Source§impl From<ProfileError> for AuthError
Available on non-WebAssembly only.
impl From<ProfileError> for AuthError
Source§fn from(e: ProfileError) -> AuthError
fn from(e: ProfileError) -> AuthError
Source§impl From<RegionError> for AuthError
impl From<RegionError> for AuthError
Source§fn from(e: RegionError) -> AuthError
fn from(e: RegionError) -> AuthError
Source§impl From<RequestError> for AuthError
impl From<RequestError> for AuthError
Source§fn from(source: RequestError) -> AuthError
fn from(source: RequestError) -> AuthError
Source§impl From<ServerError> for AuthError
impl From<ServerError> for AuthError
Source§fn from(source: ServerError) -> AuthError
fn from(source: ServerError) -> AuthError
Source§impl From<StoreError> for AuthError
impl From<StoreError> for AuthError
Source§fn from(source: StoreError) -> AuthError
fn from(source: StoreError) -> AuthError
Source§impl From<TokenExpired> for AuthError
impl From<TokenExpired> for AuthError
Source§fn from(source: TokenExpired) -> AuthError
fn from(source: TokenExpired) -> AuthError
Source§impl From<UnsupportedRegion> for AuthError
impl From<UnsupportedRegion> for AuthError
Source§fn from(source: UnsupportedRegion) -> AuthError
fn from(source: UnsupportedRegion) -> AuthError
Source§impl From<WorkspaceMismatch> for AuthError
impl From<WorkspaceMismatch> for AuthError
Source§fn from(source: WorkspaceMismatch) -> AuthError
fn from(source: WorkspaceMismatch) -> AuthError
Source§impl Serialize for AuthError
Serialize an AuthError into the flat, FFI-facing shape consumed by the
Node and Wasm bindings: { type, message, help?, url?, ...payload }.
impl Serialize for AuthError
Serialize an AuthError into the flat, FFI-facing shape consumed by the
Node and Wasm bindings: { type, message, help?, url?, ...payload }.
type/message come from the canonical code and Display; help/url
are captured generically from the miette::Diagnostic surface (so
per-variant help stays colocated on the struct); extra structured fields
come from AuthErrorKind::payload.
serialize_map lets the wasm binding render this as a plain JS object via
Serializer::serialize_maps_as_objects(true); serde_json renders a JSON
object directly.
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl !RefUnwindSafe for AuthError
impl !UnwindSafe for AuthError
impl Freeze for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnsafeUnpin for AuthError
Blanket Implementations§
impl<T> AuthStrategyBounds for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§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.