pub enum Error {
Parsing(Box<ErrorDetails>),
Inversion(Box<ErrorDetails>),
Validation(Box<ErrorDetails>),
Registry {
details: Box<ErrorDetails>,
identifier: String,
kind: RegistryErrorKind,
},
ResourceLimitExceeded {
details: Box<ErrorDetails>,
limit_name: String,
limit_value: String,
actual_value: String,
},
Request(Box<ErrorDetails>),
}Expand description
Error types for the Lemma system with source location tracking
Variants§
Parsing(Box<ErrorDetails>)
Parse error with source location
Inversion(Box<ErrorDetails>)
Inversion error (valid Lemma, but unsupported by inversion) with source location
Validation(Box<ErrorDetails>)
Validation error (semantic/planning, including circular dependency) with source location
Registry
Registry resolution error with source location and structured error kind.
Produced when an @... reference cannot be resolved by the configured Registry
(e.g. the spec was not found, the request was unauthorized, or the network
is unreachable).
ResourceLimitExceeded
Resource limit exceeded
Request(Box<ErrorDetails>)
Request error: invalid or unsatisfiable API request (e.g. spec not found, invalid parameters). Not a parse/planning failure; the request itself is invalid. Such errors occur before any evaluation and never during evaluation.
Implementations§
Source§impl Error
impl Error
Sourcepub fn parsing(
message: impl Into<String>,
source: Source,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn parsing( message: impl Into<String>, source: Source, suggestion: Option<impl Into<String>>, ) -> Self
Create a parse error. Source is required: parsing errors always originate from source code.
Sourcepub fn parsing_with_suggestion(
message: impl Into<String>,
source: Source,
suggestion: impl Into<String>,
) -> Self
pub fn parsing_with_suggestion( message: impl Into<String>, source: Source, suggestion: impl Into<String>, ) -> Self
Create a parse error with suggestion. Source is required.
Sourcepub fn inversion(
message: impl Into<String>,
source: Option<Source>,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn inversion( message: impl Into<String>, source: Option<Source>, suggestion: Option<impl Into<String>>, ) -> Self
Create an inversion error with source information.
Sourcepub fn inversion_with_suggestion(
message: impl Into<String>,
source: Option<Source>,
suggestion: impl Into<String>,
) -> Self
pub fn inversion_with_suggestion( message: impl Into<String>, source: Option<Source>, suggestion: impl Into<String>, ) -> Self
Create an inversion error with suggestion
Sourcepub fn validation(
message: impl Into<String>,
source: Option<Source>,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn validation( message: impl Into<String>, source: Option<Source>, suggestion: Option<impl Into<String>>, ) -> Self
Create a validation error with source information (semantic/planning, including circular dependency).
Sourcepub fn request(
message: impl Into<String>,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn request( message: impl Into<String>, suggestion: Option<impl Into<String>>, ) -> Self
Create a request error (invalid API request, e.g. spec not found). Request errors never have source locations — they are API-level.
Sourcepub fn resource_limit_exceeded(
limit_name: impl Into<String>,
limit_value: impl Into<String>,
actual_value: impl Into<String>,
suggestion: impl Into<String>,
source: Option<Source>,
) -> Self
pub fn resource_limit_exceeded( limit_name: impl Into<String>, limit_value: impl Into<String>, actual_value: impl Into<String>, suggestion: impl Into<String>, source: Option<Source>, ) -> Self
Create a resource-limit-exceeded error with optional source location.
Sourcepub fn validation_with_context(
message: impl Into<String>,
source: Option<Source>,
suggestion: Option<impl Into<String>>,
related_spec: Option<Arc<LemmaSpec>>,
) -> Self
pub fn validation_with_context( message: impl Into<String>, source: Option<Source>, suggestion: Option<impl Into<String>>, related_spec: Option<Arc<LemmaSpec>>, ) -> Self
Create a validation error with optional related spec (for spec-interface errors). When related_spec is set, Display shows “See spec ‘X’ (active from Y).”
Sourcepub fn registry(
message: impl Into<String>,
source: Source,
identifier: impl Into<String>,
kind: RegistryErrorKind,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn registry( message: impl Into<String>, source: Source, identifier: impl Into<String>, kind: RegistryErrorKind, suggestion: Option<impl Into<String>>, ) -> Self
Create a registry error. Source is required: registry errors point to @ref in source.
Sourcepub fn with_spec_context(self, spec: Arc<LemmaSpec>) -> Self
pub fn with_spec_context(self, spec: Arc<LemmaSpec>) -> Self
Attach spec context for display grouping. Returns a new Error with context set.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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 Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.