pub enum Error {
Show 27 variants
SchemaMismatch {
database_name: String,
schema: SchemaName,
stored_schema: SchemaName,
},
SchemaAlreadyRegistered(SchemaName),
SchemaNotRegistered(SchemaName),
ViewAlreadyRegistered(ViewName),
InvalidDatabaseName(String),
DatabaseNotFound(String),
ViewNotFound,
CollectionNotFound,
ApiNotFound(ApiName),
DatabaseNameAlreadyTaken(String),
Networking(Error),
CollectionAlreadyDefined,
DocumentNotFound(CollectionName, Box<DocumentId>),
DocumentIdTooLong,
DocumentConflict(CollectionName, Box<Header>),
UniqueKeyViolation {
view: ViewName,
conflicting_document: Box<Header>,
existing_document: Box<Header>,
},
DocumentPush(CollectionName, NextValueError),
InvalidName(InvalidNameError),
PermissionDenied(PermissionDenied),
Password(String),
UserNotFound,
InvalidUnicode(String),
InvalidCredentials,
ReduceUnimplemented,
NotANumber,
Time(TimeError),
Other {
origin: String,
error: String,
},
}Expand description
an enumeration of errors that this crate can produce
Variants§
SchemaMismatch
The database named database_name was created with a different schema
(stored_schema) than provided (schema).
Fields
schema: SchemaNameThe schema provided for the database.
stored_schema: SchemaNameThe schema stored for the database.
SchemaAlreadyRegistered(SchemaName)
The SchemaName returned has already been registered.
SchemaNotRegistered(SchemaName)
The SchemaName requested was not registered.
ViewAlreadyRegistered(ViewName)
The ViewName returned has already been registered.
InvalidDatabaseName(String)
An invalid database name was specified. See
StorageConnection::create_database()
for database name requirements.
DatabaseNotFound(String)
The database name given was not found.
ViewNotFound
The view was not found.
CollectionNotFound
The collection was not found.
ApiNotFound(ApiName)
The api invoked was not found.
DatabaseNameAlreadyTaken(String)
The database name already exists.
Networking(Error)
An error occurred from networking.
CollectionAlreadyDefined
A Collection being added already exists. This can be caused by a collection name not being unique.
DocumentNotFound(CollectionName, Box<DocumentId>)
An attempt to update a document that doesn’t exist.
DocumentIdTooLong
A value provided as a DocumentId exceeded DocumentId::MAX_LENGTH.
DocumentConflict(CollectionName, Box<Header>)
When updating a document, if a situation is detected where the contents
have changed on the server since the Revision provided, a Conflict
error will be returned.
UniqueKeyViolation
When saving a document in a collection with unique views, a document emits a key that is already emitted by an existing ocument, this error is returned.
Fields
DocumentPush(CollectionName, NextValueError)
When pushing a document, an error occurred while generating the next unique id.
InvalidName(InvalidNameError)
An invalid name was specified during schema creation.
PermissionDenied(PermissionDenied)
Permission was denied.
Password(String)
An internal error handling passwords was encountered.
UserNotFound
The user specified was not found. This will not be returned in response to an invalid username being used during login. It will be returned in other APIs that operate upon users.
InvalidUnicode(String)
An error occurred converting from bytes to Utf-8.
InvalidCredentials
The credentials specified are not valid.
ReduceUnimplemented
Returned when the a view’s reduce() function is unimplemented.
NotANumber
A floating point operation yielded Not a Number.
Time(TimeError)
An error while operating with a time
Other
An error from another crate.
Implementations§
Source§impl Error
impl Error
Sourcepub fn other(origin: impl Display, error: impl Display) -> Self
pub fn other(origin: impl Display, error: impl Display) -> Self
Returns an instance of Self::Other with the given parameters.
Sourcepub fn is_unique_key_error<View: View, C: HasSchema>(
&self,
connection: &C,
) -> bool
pub fn is_unique_key_error<View: View, C: HasSchema>( &self, connection: &C, ) -> bool
Returns true if this error is a Error::UniqueKeyViolation from
View.
Sourcepub fn conflicting_document<Collection: Collection>(&self) -> Option<Header>
pub fn conflicting_document<Collection: Collection>(&self) -> Option<Header>
Returns the header of the conflicting document if this error is a
Error::DocumentConflict from Collection.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Error for Error
impl Error for Error
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 From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(err: FromUtf8Error) -> Self
fn from(err: FromUtf8Error) -> Self
Source§impl<T> From<InsertError<T>> for Error
impl<T> From<InsertError<T>> for Error
Source§fn from(err: InsertError<T>) -> Self
fn from(err: InsertError<T>) -> Self
Source§impl From<InvalidHexadecimal> for Error
impl From<InvalidHexadecimal> for Error
Source§fn from(err: InvalidHexadecimal) -> Self
fn from(err: InvalidHexadecimal) -> Self
Source§impl From<InvalidNameError> for Error
impl From<InvalidNameError> for Error
Source§fn from(source: InvalidNameError) -> Self
fn from(source: InvalidNameError) -> Self
Source§impl From<PermissionDenied> for Error
impl From<PermissionDenied> for Error
Source§fn from(source: PermissionDenied) -> Self
fn from(source: PermissionDenied) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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