pub enum ForgeError {
Show 13 variants
UnsupportedModel(UnsupportedModelError),
ToolCall(ToolCallError),
ToolExecution(ToolExecutionError),
WorkflowCancelled(WorkflowCancelledError),
MaxIterations(MaxIterationsError),
StepEnforcement(StepEnforcementError),
Prerequisite(PrerequisiteError),
ContextBudgetExceeded(ContextBudgetExceeded),
HardwareDetection(HardwareDetectionError),
ContextDiscovery(ContextDiscoveryError),
BudgetResolution(BudgetResolutionError),
Backend(BackendError),
Stream(StreamError),
}Expand description
Base error type for the forge-guardrails framework.
All framework errors except ToolResolutionError are represented as
variants of this enum, preserving catch-as-base semantics.
Variants§
UnsupportedModel(UnsupportedModelError)
The model is not supported.
ToolCall(ToolCallError)
Failed to parse/construct a tool call.
ToolExecution(ToolExecutionError)
Tool execution failed.
WorkflowCancelled(WorkflowCancelledError)
Workflow cancelled.
MaxIterations(MaxIterationsError)
Max iterations reached.
StepEnforcement(StepEnforcementError)
Premature terminal tool call step violation.
Prerequisite(PrerequisiteError)
Prerequisite step check failed.
ContextBudgetExceeded(ContextBudgetExceeded)
Context budget tokens exceeded.
HardwareDetection(HardwareDetectionError)
Hardware detection failed.
ContextDiscovery(ContextDiscoveryError)
Context length discovery failed.
BudgetResolution(BudgetResolutionError)
Budget resolution failed.
Backend(BackendError)
Backend request failed.
Stream(StreamError)
Stream error.
Trait Implementations§
Source§impl Debug for ForgeError
impl Debug for ForgeError
Source§impl Display for ForgeError
impl Display for ForgeError
Source§impl Error for ForgeError
impl Error for ForgeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<BackendError> for ForgeError
impl From<BackendError> for ForgeError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Converts to this type from the input type.
Source§impl From<BudgetResolutionError> for ForgeError
impl From<BudgetResolutionError> for ForgeError
Source§fn from(source: BudgetResolutionError) -> Self
fn from(source: BudgetResolutionError) -> Self
Converts to this type from the input type.
Source§impl From<ContextBudgetExceeded> for ForgeError
impl From<ContextBudgetExceeded> for ForgeError
Source§fn from(source: ContextBudgetExceeded) -> Self
fn from(source: ContextBudgetExceeded) -> Self
Converts to this type from the input type.
Source§impl From<ContextDiscoveryError> for ForgeError
impl From<ContextDiscoveryError> for ForgeError
Source§fn from(source: ContextDiscoveryError) -> Self
fn from(source: ContextDiscoveryError) -> Self
Converts to this type from the input type.
Source§impl From<HardwareDetectionError> for ForgeError
impl From<HardwareDetectionError> for ForgeError
Source§fn from(source: HardwareDetectionError) -> Self
fn from(source: HardwareDetectionError) -> Self
Converts to this type from the input type.
Source§impl From<MaxIterationsError> for ForgeError
impl From<MaxIterationsError> for ForgeError
Source§fn from(source: MaxIterationsError) -> Self
fn from(source: MaxIterationsError) -> Self
Converts to this type from the input type.
Source§impl From<PrerequisiteError> for ForgeError
impl From<PrerequisiteError> for ForgeError
Source§fn from(source: PrerequisiteError) -> Self
fn from(source: PrerequisiteError) -> Self
Converts to this type from the input type.
Source§impl From<StepEnforcementError> for ForgeError
impl From<StepEnforcementError> for ForgeError
Source§fn from(source: StepEnforcementError) -> Self
fn from(source: StepEnforcementError) -> Self
Converts to this type from the input type.
Source§impl From<StreamError> for ForgeError
impl From<StreamError> for ForgeError
Source§fn from(source: StreamError) -> Self
fn from(source: StreamError) -> Self
Converts to this type from the input type.
Source§impl From<ToolCallError> for ForgeError
impl From<ToolCallError> for ForgeError
Source§fn from(source: ToolCallError) -> Self
fn from(source: ToolCallError) -> Self
Converts to this type from the input type.
Source§impl From<ToolExecutionError> for ForgeError
impl From<ToolExecutionError> for ForgeError
Source§fn from(source: ToolExecutionError) -> Self
fn from(source: ToolExecutionError) -> Self
Converts to this type from the input type.
Source§impl From<UnsupportedModelError> for ForgeError
impl From<UnsupportedModelError> for ForgeError
Source§fn from(source: UnsupportedModelError) -> Self
fn from(source: UnsupportedModelError) -> Self
Converts to this type from the input type.
Source§impl From<WorkflowCancelledError> for ForgeError
impl From<WorkflowCancelledError> for ForgeError
Source§fn from(source: WorkflowCancelledError) -> Self
fn from(source: WorkflowCancelledError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ForgeError
impl RefUnwindSafe for ForgeError
impl Send for ForgeError
impl Sync for ForgeError
impl Unpin for ForgeError
impl UnsafeUnpin for ForgeError
impl UnwindSafe for ForgeError
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.