pub enum AtProtoError {
Transport(Error),
Xrpc {
status: StatusCode,
error: String,
message: Option<String>,
},
HandleResolution {
handle: String,
},
DidResolution {
did: String,
reason: String,
},
}Expand description
Errors from the atproto identity + PDS layer.
Wraps the transport, the atproto XRPC error envelope ({"error","message"}),
and the identity-resolution failure modes so callers can distinguish “the
network broke” from “the PDS said no” from “this handle doesn’t resolve”.
Variants§
Transport(Error)
The underlying HTTP transport failed (DNS, TLS, timeout, connect).
Xrpc
The XRPC endpoint returned a non-2xx status with an atproto error
envelope (or an opaque body). error is the atproto error name (e.g.
RecordNotFound, AuthMissing), message the human string.
Fields
status: StatusCodeThe HTTP status code.
HandleResolution
A handle could not be resolved to a DID.
DidResolution
A DID document could not be resolved, or lacks a usable PDS service
endpoint (#atproto_pds).
Implementations§
Source§impl AtProtoError
impl AtProtoError
Sourcepub fn is_record_not_found(&self) -> bool
pub fn is_record_not_found(&self) -> bool
True when the XRPC error is a “record not found” — handy for upsert paths that treat a missing record as “create instead of update”.
Trait Implementations§
Source§impl Debug for AtProtoError
impl Debug for AtProtoError
Source§impl Display for AtProtoError
impl Display for AtProtoError
Source§impl Error for AtProtoError
impl Error for AtProtoError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for AtProtoError
impl !UnwindSafe for AtProtoError
impl Freeze for AtProtoError
impl Send for AtProtoError
impl Sync for AtProtoError
impl Unpin for AtProtoError
impl UnsafeUnpin for AtProtoError
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more