pub enum RoutineError {
FunctionArityMismatch {
function: Fragment,
expected: usize,
actual: usize,
},
FunctionInvalidArgumentType {
function: Fragment,
argument_index: usize,
expected: Vec<Type>,
actual: Type,
},
FunctionExecutionFailed {
function: Fragment,
reason: String,
},
FunctionNotFound {
function: Fragment,
},
ProcedureArityMismatch {
procedure: Fragment,
expected: usize,
actual: usize,
},
ProcedureInvalidArgumentType {
procedure: Fragment,
argument_index: usize,
expected: Vec<Type>,
actual: Type,
},
ProcedureExecutionFailed {
procedure: Fragment,
reason: String,
},
Wrapped(Box<Error>),
}Expand description
Unified error type for all routines (functions and procedures).
Replaces the previously-separate FunctionError and ProcedureError.
Variant names are prefixed (Function* / Procedure*) so the user-visible
diagnostic wording can stay distinct, but the field names within each
variant follow the legacy convention (function: / procedure:) so the
migration from the legacy types only changes the variant name, not the
per-variant struct layout.
Variants§
FunctionArityMismatch
FunctionInvalidArgumentType
FunctionExecutionFailed
FunctionNotFound
ProcedureArityMismatch
ProcedureInvalidArgumentType
ProcedureExecutionFailed
Wrapped(Box<Error>)
Implementations§
Source§impl RoutineError
impl RoutineError
Sourcepub fn with_context(self, fragment: Fragment, is_procedure: bool) -> Error
pub fn with_context(self, fragment: Fragment, is_procedure: bool) -> Error
Attach routine name context to Wrapped errors.
is_procedure selects whether the wrapped diagnostic uses the FUNCTION_007
or PROCEDURE_003 code so the user-visible wording stays correct.
Trait Implementations§
Source§impl Debug for RoutineError
impl Debug for RoutineError
Source§impl Display for RoutineError
impl Display for RoutineError
Source§impl Error for RoutineError
impl Error for RoutineError
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<CatalogError> for RoutineError
impl From<CatalogError> for RoutineError
Source§fn from(err: CatalogError) -> Self
fn from(err: CatalogError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for RoutineError
impl From<Error> for RoutineError
Source§impl From<RoutineError> for Error
impl From<RoutineError> for Error
Source§fn from(err: RoutineError) -> Self
fn from(err: RoutineError) -> Self
Converts to this type from the input type.
Source§impl From<TypeError> for RoutineError
impl From<TypeError> for RoutineError
Source§impl IntoDiagnostic for RoutineError
impl IntoDiagnostic for RoutineError
Source§fn into_diagnostic(self) -> Diagnostic
fn into_diagnostic(self) -> Diagnostic
Convert self into a Diagnostic with error code, message, fragment, and other metadata.
Auto Trait Implementations§
impl Freeze for RoutineError
impl RefUnwindSafe for RoutineError
impl Send for RoutineError
impl Sync for RoutineError
impl Unpin for RoutineError
impl UnsafeUnpin for RoutineError
impl UnwindSafe for RoutineError
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 more