pub enum KgWriteError {
Admission(Error),
Assert(Error),
CacheRefresh(Error),
}Expand description
Why a caller-supplied KG assert did not complete.
Why: the three failure points have genuinely different meanings to a
caller. Admission means nothing was written and the caller should fix the
request; Assert means nothing was written and the daemon is at fault;
CacheRefresh means the triple IS in storage but the always-injected
surface is stale. Collapsing them into one opaque error would leave HTTP
unable to choose 400 vs 500, and would let the third be mistaken for a
clean success — which is the bug in #5524 and #4905.
What: a thiserror enum over anyhow::Error. Admission is transparent so
the Tier S refusal text (which names the occupants and the tool that
retires one) reaches the caller unchanged.
Test: kg_write_admission_refusal_leaves_storage_and_cache_untouched.
Variants§
Admission(Error)
The Tier S gate refused the write. Nothing was stored.
Assert(Error)
The KG write itself failed. Nothing was stored.
CacheRefresh(Error)
The triple was stored but the prompt cache could not be rebuilt, so the fact is not yet on the always-injected surface.
Trait Implementations§
Source§impl Debug for KgWriteError
impl Debug for KgWriteError
Source§impl Display for KgWriteError
impl Display for KgWriteError
Source§impl Error for KgWriteError
impl Error for KgWriteError
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 Freeze for KgWriteError
impl RefUnwindSafe for KgWriteError
impl Send for KgWriteError
impl Sync for KgWriteError
impl Unpin for KgWriteError
impl UnsafeUnpin for KgWriteError
impl UnwindSafe for KgWriteError
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more