pub enum LinkError {
Show 30 variants
NoHub,
NoCredential,
BadKey,
UnboundCredential,
BadAgentKey {
message: String,
},
UnsafeHub {
hub: String,
},
Transport {
hub: String,
message: String,
},
Http {
what: &'static str,
status: u16,
message: String,
code: Option<String>,
details: Option<Value>,
},
NotJson {
what: &'static str,
status: u16,
},
ResponseTooLarge {
limit_bytes: u64,
},
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,
},
AliasRebindRequired {
alias: String,
from: String,
to: String,
},
Conflict {
paths: Vec<String>,
},
ConflictBundle {
bundle: String,
paths: Vec<String>,
},
LocalPolicyTransition {
paths: Vec<String>,
},
BulkPreviewRequired {
preview: Value,
},
ScopedProjectionModified,
ScopedViewChanged,
BrainUnavailable,
RemoteAdvancedDuringSync,
UnsupportedPlatform {
operation: &'static str,
},
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.
UnboundCredential
A store selected the destination while an ambient credential was present, but the operator did not bind that credential to the same origin. This is a hard refusal, not an anonymous fallback: silently dropping a credential can turn an intended private operation into a confusing public one.
BadAgentKey
The agent signing key file named by AGENT_KEY_FILE_ENV is missing,
unreadable, or not a valid Ed25519 PKCS#8 — key material is never
echoed.
UnsafeHub
A non-HTTPS hub outside loopback: the bearer key would travel in cleartext.
Transport
TCP/TLS-level failure: the hub never answered.
Http
The hub answered with an HTTP error status.
Fields
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
ResponseTooLarge
The hub response exceeded the selected endpoint’s byte cap.
BadAddress
A malformed @brain/id address.
BadGrantId
A grant id whose shape cannot travel as a URL path segment.
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.
PushTooLarge
The store exceeds the hub’s bounded whole-snapshot caps.
ProposeTooLarge
The propose body exceeds the hub’s inbox cap.
NotUtf8
A store file that is not valid UTF-8 cannot travel the JSON push path.
InvalidPack
A downloaded pack failed validation before any local write.
InvalidFeed
A signed feed entry, hash chain, or advertised feed head did not verify.
AliasRebindRequired
A mutable alias moved to another canonical brain. Ordinary sync fails closed; only the exact old/new ids can authorize replacing that one alias binding while preserving both canonical trust histories.
Conflict
Local and remote both changed one or more coordinates since the last verified sync baseline. No side was overwritten.
ConflictBundle
A readable v2 conflict was preserved as a private, exact-head bundle. The bundle is local control state; none of its bytes ride with the brain, and resolving it always creates a fresh explicit mutation.
Fields
LocalPolicyTransition
.sevralocal newly made paths eligible to ride. Uploading them is an
explicit adoption boundary, never an accidental side effect of editing
or removing a local policy file.
BulkPreviewRequired
The exact mutation crosses a permissioned bulk-impact boundary. The
hub has not committed it; preview is the bounded, permission-filtered
receipt an agent must inspect before explicitly confirming the same
request.
ScopedProjectionModified
A scoped checkout’s generated store marker was edited or removed. It is local projection metadata and is never accepted as brain data.
ScopedViewChanged
The effective permission slice changed after this checkout was pinned. Reusing the directory could conceal removals or accidentally adopt files revealed by a wider grant, so a new checkout is required.
A v2 identity/head was previously accepted for this ref, but the hub now hides it. Never reinterpret that as a v1 downgrade.
RemoteAdvancedDuringSync
The verified remote head advanced while a pull or post-commit barrier was in flight. The old baseline is deliberately retained.
UnsupportedPlatform
This build cannot provide the no-follow, directory-handle-relative filesystem semantics required for trust/key/snapshot state.
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 Error for LinkError
impl Error for LinkError
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()