Enum bonsaidb_core::Error
source · pub enum Error {
Show 33 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),
Database(String),
Serialization(String),
Server(String),
Transport(String),
Websocket(String),
Networking(Error),
Io(String),
Configuration(String),
Client(String),
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,
}
Expand description
an enumeration of errors that this crate can produce
Variants§
SchemaMismatch
Fields
schema: SchemaName
The schema provided for the database.
stored_schema: SchemaName
The schema stored for the database.
The database named database_name
was created with a different schema
(stored_schema
) than provided (schema
).
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.
Database(String)
An error from interacting with local storage.
Serialization(String)
An error serializing data.
Server(String)
An error from interacting with a server.
Transport(String)
An error occurred from the QUIC transport layer.
Websocket(String)
An error occurred from the websocket transport layer.
Networking(Error)
An error occurred from networking.
Io(String)
An error occurred from IO.
Configuration(String)
An error occurred with the provided configuration options.
Client(String)
An error occurred inside of the client.
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
Fields
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.
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.