#[non_exhaustive]pub enum ErrorCode {
InvalidRef,
NoOaAvailable,
RateLimited,
NetworkError,
StoreError,
LogError,
CapabilityDenied,
FetchTimeout,
SchemaTooNew,
LockTimeout,
InternalError,
NotImplemented,
}Expand description
The closed set of error codes doiget surfaces.
See docs/ERRORS.md for the persona × code matrix.
Marked #[non_exhaustive] so adding new variants is a minor (not major)
version bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRef
DOI / arXiv id failed validation.
NoOaAvailable
Tier 1 sources reported no OA URL.
RateLimited
Internal rate cap or upstream 429.
NetworkError
Transport / DNS / TLS failure.
StoreError
Filesystem write failed.
LogError
Provenance log write failed; the fetch was aborted.
CapabilityDenied
Source not granted by the runtime CapabilityProfile.
FetchTimeout
Per-request timeout exceeded.
SchemaTooNew
Store entry’s schema_version is ahead of this build.
LockTimeout
Could not acquire flock within 5 s.
InternalError
Bug — please open an issue.
NotImplemented
Feature is spec’d but not yet wired in this Phase. Distinct from
Self::InternalError (which signals a bug) and
Self::CapabilityDenied (which signals a runtime config gate).
Returned by stubs that exist to pin the public surface ahead of
orchestrator implementation, so an agent can react with “wait for
next minor release” rather than “report a bug” or “tweak my
capability profile”. Wire form: "NOT_IMPLEMENTED".
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn as_wire(&self) -> &'static str
pub fn as_wire(&self) -> &'static str
The SCREAMING_SNAKE_CASE wire token for this code, as a
&'static str. Identical to the serde representation but
allocation-free and usable where a borrowed string with a
'static lifetime is required — notably the provenance log
error_code column (docs/PROVENANCE_LOG.md §3), so a failure
row records the actual mapped code instead of a hand-written
literal that can drift from this enum (issue #118).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&FetchError> for ErrorCode
Borrow-form of the collapse above, so a caller that still needs the
error for its Display message / denial_context side-channel
(notably the CLI human-persona renderer, issue #119) can obtain the
closed code without consuming it. The owned impl delegates here so
the mapping table lives in exactly one place.
impl From<&FetchError> for ErrorCode
Borrow-form of the collapse above, so a caller that still needs the
error for its Display message / denial_context side-channel
(notably the CLI human-persona renderer, issue #119) can obtain the
closed code without consuming it. The owned impl delegates here so
the mapping table lives in exactly one place.
Source§fn from(e: &FetchError) -> ErrorCode
fn from(e: &FetchError) -> ErrorCode
Source§impl From<FetchError> for ErrorCode
Map FetchError to the closed crate::ErrorCode set surfaced at
the public CLI / MCP boundary. Mirrors the
From<RefParseError> for ErrorCode collapse from PR #55.
impl From<FetchError> for ErrorCode
Map FetchError to the closed crate::ErrorCode set surfaced at
the public CLI / MCP boundary. Mirrors the
From<RefParseError> for ErrorCode collapse from PR #55.