pub enum Error {
Input(LoadError),
IoError(Error),
BadCall(String, SourcePos, Option<SourcePos>),
ImportLoop(bool, SourcePos, Option<SourcePos>),
BadRange(RangeError),
ParseError(ParseError),
Invalid(Invalid, SourcePos),
S(String),
}
Expand description
Many functions in rsass that returns a Result uses this Error type.
Other errors in rsass, such as CallError
or
Invalid
can be converted to this Error type, often with
a method providing some context rather than with just an Into
implementation.
E.g. CallError::called_from
also takes a SourcePos
and a function name, defining the call
that went wrong.
Variants§
Input(LoadError)
Failed to load a file.
IoError(Error)
An IO error without specifying a path.
This is (probably) an error writing output.
BadCall(String, SourcePos, Option<SourcePos>)
A failed function call, with call- and optionally declaration position.
ImportLoop(bool, SourcePos, Option<SourcePos>)
Tried to import file at pos while already importing it at pos.
The bool is true for a used module and false for an import.
BadRange(RangeError)
A range error
ParseError(ParseError)
Error parsing sass data.
Invalid(Invalid, SourcePos)
Something bad at a specific position.
S(String)
Fallback error type.
This just contains a string with some message.
Note: This variant should probably be removed in the future.