pub enum StamError {
Show 29 variants
HandleError(&'static str),
IdNotFoundError(String, &'static str),
NotFoundError(Type, &'static str),
NoIdError(&'static str),
Unbound(&'static str),
AlreadyBound(&'static str),
AlreadyExists(usize, &'static str),
DuplicateIdError(String, &'static str),
BuildError(Box<StamError>, &'static str),
StoreError(Box<StamError>, &'static str),
IOError(Error, String, &'static str),
JsonError(Error<Error>, String, &'static str),
CsvError(String, &'static str),
RegexError(Error, &'static str),
QuerySyntaxError(String, &'static str),
SerializationError(String),
DeserializationError(String),
WrongSelectorType(&'static str),
WrongSelectorTarget(&'static str),
CursorOutOfBounds(Cursor, &'static str),
InvalidOffset(Cursor, Cursor, &'static str),
InvalidCursor(String, &'static str),
NoTarget(&'static str),
NoText(&'static str),
InUse(&'static str),
IncompleteError(String, &'static str),
ValueError(String, &'static str),
UndefinedVariable(String, &'static str),
OtherError(&'static str),
}Expand description
This enum groups the different kind of errors that this STAM library can produce
Variants§
HandleError(&'static str)
This error is raised when the specified internal ID does not exist. The first parameter is the requested internal ID
IdNotFoundError(String, &'static str)
This error is raised when the specified public ID does not exist The first parameter is the requested public ID
NotFoundError(Type, &'static str)
A more generic NotFound error
NoIdError(&'static str)
This error is raised when an item has no public ID but one is expected
Unbound(&'static str)
This error is raised when an item has no internal ID but one is expected. This happens when an item is instantiated but not yet added to a store. We such an item unbound.
AlreadyBound(&'static str)
This error is raised when an item is already bound and you are trying it again
AlreadyExists(usize, &'static str)
This error is raised when an item is already exists and you are adding it again
DuplicateIdError(String, &'static str)
This error is raised when you attempt to set a public ID that is already in use (within a particular scope) The first parameter is the requested public ID
BuildError(Box<StamError>, &'static str)
This error indicates there was an error during the building of an item from its recipe. It wraps the deeper error that occured.
StoreError(Box<StamError>, &'static str)
This error indicates there was an error during the storage of an item It wraps the deeper error that occured.
IOError(Error, String, &'static str)
This error indicates there was an Input/Output error. It wraps the deeper error that occured.
JsonError(Error<Error>, String, &'static str)
This error indicates there was an error during JSON parsing. It wraps the deeper error that occurred.
CsvError(String, &'static str)
This error indicates there was an error during CSV parsing. It wraps the deeper error that occurred.
RegexError(Error, &'static str)
This error is raised when there is an error in regular expressions
QuerySyntaxError(String, &'static str)
A syntax error in query syntax
SerializationError(String)
DeserializationError(String)
WrongSelectorType(&'static str)
This error is raised when you ask a selector to do something it is not capable of because it is the wrong type of selector
WrongSelectorTarget(&'static str)
This error is raised when you apply a selector on a target it is not intended for
CursorOutOfBounds(Cursor, &'static str)
This error indicates the cursor is out of bounds when applied to the text.
InvalidOffset(Cursor, Cursor, &'static str)
This error indicates the offset is invalid, the end precedes the beginning. It wraps the begin and end cursors, respectively
InvalidCursor(String, &'static str)
This error indicates the cursor is invalid
NoTarget(&'static str)
Annotation has no target
NoText(&'static str)
Annotation has no text
InUse(&'static str)
Called when removal of an item is requested but it is still being referenced.
IncompleteError(String, &'static str)
This error is raised when the information supplied during build is incomplete
ValueError(String, &'static str)
Unexpected value error
UndefinedVariable(String, &'static str)
Undefined variable in query
OtherError(&'static str)
Category for other errors, try to use this sparingly
Trait Implementations§
source§impl Error for StamError
impl Error for StamError
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
source§impl Error for StamError
impl Error for StamError
source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a type different from what it was
expecting. Read moresource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moresource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize enum type received a variant with an
unrecognized name.source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize struct type received a field with an
unrecognized name.source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Deserialize struct type received more than one of the
same field.