pub enum ErrorCode {
Show 13 variants
InvalidRequest,
MultiQueryLimitExceeded,
Unauthorized,
Forbidden,
NotFound,
EmbeddingModelMismatch,
RunAborted,
RateLimited,
Internal,
ServiceUnavailable,
CloudUnreachable,
ModelsMissing,
TelemetrySchemaInvalid,
}Expand description
Canonical machine-readable error codes.
New variants are additive (MINOR bump per Constitution X). Removing or renaming a variant is a MAJOR contract break.
Variants§
InvalidRequest
Generic 400 — payload failed validation. context should name the field.
MultiQueryLimitExceeded
400 — queries.length > MIDNIGHT_MANUAL_MAX_QUERIES_PER_REQUEST (D25, FR-088).
401 — JWT missing, signature invalid, or token expired. Remediation: mnm login.
Forbidden
403 — caller authenticated but lacks the required role for this endpoint.
NotFound
404 — resource not found (source slug, chunk id, etc.).
EmbeddingModelMismatch
409 — client_embedding_model disagrees with the corpus’s active model (D12, FR-038).
RunAborted
409 — write attempted against an ingest_run already in aborted state (FR-022).
RateLimited
429 — per-IP / SSO / CIDR rate-limit budget exhausted (D11, FR-031).
Internal
500 — internal invariant violated. Should be rare; logged with request_id.
503 — transient backend unavailability (DB down, model not yet loaded). Caller
should retry per the Retry-After header (Constitution VI, FR-035).
CloudUnreachable
503 — MCP-tool-side: the local cloud client could not reach the server.
ModelsMissing
503 — MCP-tool-side: local ML model file missing or corrupt; remediation: retry — the
reranker loads lazily on first use (or pre-fetch via mnm models pull).
TelemetrySchemaInvalid
500 — telemetry event failed schema validation; dropped server-side (FR-109).
Implementations§
Trait Implementations§
impl Copy for ErrorCode
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>,
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.