pub enum ErrorCode {
Show 17 variants
TooManyOptions,
TooManyQuestions,
InvalidRequest,
TooFewOptions,
InvalidLevels,
EmptyState,
EmptyQuestion,
DuplicateQuestionId,
EmptyQuestionId,
DuplicateOption,
NoQuestions,
UnknownModel,
InvalidCalibration,
NoLabelMatched,
HostUnavailable,
HostTimeout,
Internal,
}Expand description
Machine-readable failure reasons. Callers branch on these, not on message.
Variants§
TooManyOptions
More than MAX_OPTIONS options. v1 does not split these across passes.
TooManyQuestions
More than MAX_QUESTIONS questions in one request.
InvalidRequest
The body is not a request at all: malformed JSON, a wrong type, an unknown field, or a question naming more or fewer than one primitive.
TooFewOptions
Option list empty, or a single option — there is nothing to decide.
InvalidLevels
Level count outside MIN_LEVELS..=MAX_LEVELS.
EmptyState
EmptyQuestion
DuplicateQuestionId
EmptyQuestionId
A question id that is empty or only whitespace. The id is how its answer is found.
DuplicateOption
Two options, or two score levels, with the same text. The model is shown both, and the probability splits between them.
NoQuestions
UnknownModel
InvalidCalibration
NoLabelMatched
The model answered with no recognisable label — it is not following the instruction.
HostTimeout
Internal
A failure inside cerno itself. Not the caller’s doing, and not the model’s.
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.