Skip to main content

LinkError

Enum LinkError 

Source
pub enum LinkError {
Show 18 variants NoHub, NoCredential, BadKey, UnsafeHub { hub: String, }, Transport { hub: String, message: String, }, Http { what: &'static str, status: u16, message: String, code: Option<String>, }, NotJson { what: &'static str, status: u16, }, ResponseTooLarge, BadAddress { given: String, reason: String, }, BadGrantId { given: String, }, UnsafePath { path: String, }, PushTooLarge { detail: String, }, ProposeTooLarge { bytes: u64, }, NotUtf8 { path: String, }, InvalidPack { message: String, }, InvalidFeed { message: String, }, Io(Error), Store(StoreError),
}
Expand description

Everything that can go wrong on the wire or at its edges. Each variant maps onto one stable CLI error code; messages are single-line and never echo the credential.

Variants§

§

NoHub

No hub URL was configured anywhere (flag, env, .dbmd/config).

§

NoCredential

The verb needs a credential and none was present.

§

BadKey

The credential contains whitespace / non-ASCII (a paste artifact). The key is deliberately not echoed.

§

UnsafeHub

A non-HTTPS hub outside loopback: the bearer key would travel in cleartext.

Fields

§hub: String

The offending hub URL.

§

Transport

TCP/TLS-level failure: the hub never answered.

Fields

§hub: String

The hub base URL.

§message: String

The transport-layer error text.

§

Http

The hub answered with an HTTP error status.

Fields

§what: &'static str

What the client was doing (e.g. "resolve", "sync pull").

§status: u16

The HTTP status code.

§message: String

The hub’s own error string when it sent one, else a placeholder.

§code: Option<String>

The hub’s machine code field when it sent one.

§

NotJson

A 2xx whose body is not JSON — a captive portal, a proxy, or a wrong URL — refused here rather than deserializing into nothing downstream.

Fields

§what: &'static str

What the client was doing.

§status: u16

The (2xx) status that carried the non-JSON body.

§

ResponseTooLarge

The hub response exceeded [MAX_RESPONSE_BYTES].

§

BadAddress

A malformed @brain/id address.

Fields

§given: String

The raw address as typed.

§reason: String

Why it did not parse.

§

BadGrantId

A grant id whose shape cannot travel as a URL path segment.

Fields

§given: String

The raw id as typed.

§

UnsafePath

An exported file path that would escape or pollute the destination (absolute, .., a dot-leading segment, or an illegal character). The hub is not trusted with local path layout.

Fields

§path: String

The offending path as received.

§

PushTooLarge

The store exceeds the hub’s bounded whole-snapshot caps.

Fields

§detail: String

Which cap was hit, human-readable.

§

ProposeTooLarge

The propose body exceeds the hub’s inbox cap.

Fields

§bytes: u64

The offending body size in bytes.

§

NotUtf8

A store file that is not valid UTF-8 cannot travel the JSON push path.

Fields

§path: String

The store-relative path of the offending file.

§

InvalidPack

A downloaded pack failed validation before any local write.

Fields

§message: String

Hash, ZIP, path, count, or expansion failure.

§

InvalidFeed

A signed feed entry, hash chain, or advertised feed head did not verify.

Fields

§message: String

The failed integrity condition, without untrusted secret material.

§

Io(Error)

Local filesystem failure while materializing a pull or reading a push.

§

Store(StoreError)

A store-level failure (walking the local store for a push).

Trait Implementations§

Source§

impl Debug for LinkError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for LinkError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for LinkError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for LinkError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<StoreError> for LinkError

Source§

fn from(source: StoreError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.