pub enum CallError {
Invalid(Invalid),
BadArgument(Name, String),
Args(ArgsError, SourcePos),
Wrap(Box<Error>),
}
Expand description
An error in calling a function.
Variants§
Invalid(Invalid)
Something invalid while executing call.
BadArgument(Name, String)
An illegal value for a specific parameter.
Args(ArgsError, SourcePos)
An error matching arguments. The position is the declaration.
Wrap(Box<Error>)
An error happened during execution of the call.
Implementations§
source§impl CallError
impl CallError
sourcepub fn msg<S: ToString>(msg: S) -> Self
pub fn msg<S: ToString>(msg: S) -> Self
A generic error message inside a function.
This is like using an @error
statement inside a
sass-implemented function.
sourcepub fn incompatible_values<T: Into<Value>>(a: T, b: T) -> Self
pub fn incompatible_values<T: Into<Value>>(a: T, b: T) -> Self
The values were expected to be compatible, but wasn’t.
sourcepub fn called_from(self, call_pos: &SourcePos, name: &str) -> Error
pub fn called_from(self, call_pos: &SourcePos, name: &str) -> Error
Map this error to a crate::Error
.
Trait Implementations§
source§impl Error for CallError
impl Error for CallError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<BadSelector> for CallError
impl From<BadSelector> for CallError
source§fn from(e: BadSelector) -> Self
fn from(e: BadSelector) -> Self
Converts to this type from the input type.
source§impl From<ScopeError> for CallError
impl From<ScopeError> for CallError
source§fn from(err: ScopeError) -> Self
fn from(err: ScopeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CallError
impl !RefUnwindSafe for CallError
impl Send for CallError
impl Sync for CallError
impl Unpin for CallError
impl !UnwindSafe for CallError
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