surrealdb::err

Enum Error

Source
#[non_exhaustive]
pub enum Error {
Show 136 variants Unreachable, Deprecated(String), Thrown(String), Ds(String), Tx(String), TxFailure, TxFinished, TxReadonly, TxConditionNotMet, TxKeyAlreadyExists, TxKeyTooLarge, TxValueTooLarge, TxTooLarge, NsEmpty, DbEmpty, QueryEmpty, QueryRemaining, InvalidQuery(RenderedError), InvalidContent { value: Value, }, InvalidMerge { value: Value, }, InvalidPatch { message: String, }, PatchTest { expected: String, got: String, }, HttpDisabled, InvalidParam { name: String, }, InvalidField { line: usize, field: String, }, InvalidSplit { line: usize, field: String, }, InvalidOrder { line: usize, field: String, }, InvalidGroup { line: usize, field: String, }, InvalidLimit { value: String, }, InvalidStart { value: String, }, InvalidScript { message: String, }, InvalidFunction { name: String, message: String, }, InvalidArguments { name: String, message: String, }, InvalidUrl(String), InvalidVectorDimension { current: usize, expected: usize, }, InvalidVectorDistance { left: Arc<Vector>, right: Arc<Vector>, dist: f64, }, InvalidVectorType { current: String, expected: &'static str, }, InvalidVectorValue { current: String, }, InvalidRegex(String), QueryTimedout, QueryCancelled, QueryNotExecuted, QueryNotExecutedDetail { message: String, }, NsNotAllowed { ns: String, }, DbNotAllowed { db: String, }, NsNotFound { value: String, }, NtNotFound { value: String, }, NlNotFound { value: String, }, DbNotFound { value: String, }, DtNotFound { value: String, }, DlNotFound { value: String, }, FcNotFound { value: String, }, ScNotFound { value: String, }, ClAlreadyExists { value: String, }, NdNotFound { value: String, }, StNotFound { value: String, }, PaNotFound { value: String, }, TbNotFound { value: String, }, LvNotFound { value: String, }, LqNotFound { value: String, }, AzNotFound { value: String, }, IxNotFound { value: String, }, UnsupportedDistance(Distance), UserRootNotFound { value: String, }, UserNsNotFound { value: String, ns: String, }, UserDbNotFound { value: String, ns: String, db: String, }, RealtimeDisabled, ComputationDepthExceeded, InvalidStatementTarget { value: String, }, CreateStatement { value: String, }, UpdateStatement { value: String, }, RelateStatement { value: String, }, DeleteStatement { value: String, }, InsertStatement { value: String, }, LiveStatement { value: String, }, KillStatement { value: String, }, SingleOnlyOutput, TablePermissions { table: String, }, ParamPermissions { name: String, }, FunctionPermissions { name: String, }, TableIsView { table: String, }, RecordExists { thing: String, }, IndexExists { thing: Thing, index: String, value: String, }, FieldCheck { thing: String, value: String, field: Idiom, check: String, }, FieldValue { thing: String, value: String, field: Idiom, check: String, }, IdMismatch { value: String, }, IdInvalid { value: String, }, CoerceTo { from: Value, into: String, }, ConvertTo { from: Value, into: String, }, LengthInvalid { kind: String, size: usize, }, TryAdd(String, String), TrySub(String, String), TryMul(String, String), TryDiv(String, String), TryRem(String, String), TryPow(String, String), TryNeg(String), TryFrom(String, &'static str), Http(String), Channel(String), Io(Error), Encode(Error), Decode(Error), Revision(Error), CorruptedIndex, NoIndexFoundForMatch { value: String, }, AnalyzerError(String), HighlightError(String), Bincode(Error), FstError(Error), Utf8Error(FromUtf8Error), FeatureNotYetImplemented { feature: String, }, DuplicatedMatchRef { mr: u8, }, TimestampOverflow(String), Internal(String), Unimplemented(String), CorruptedVersionstampInKey(Error), InvalidLevel(String), IamError(Error), ScriptingNotAllowed, FunctionNotAllowed(String), NetTargetNotAllowed(String), TokenMakingFailed, NoRecordFound, SignupQueryFailed, SigninQueryFailed, ScopeNoSignup, ScopeNoSignin, NoScopeFound, MissingUserOrPass, NoSigninTarget, InvalidPass, InvalidAuth, InvalidSignup, UnknownAuth, TxKeyAlreadyExistsCategory(KeyCategory),
}
Expand description

An error originating from an embedded SurrealDB database.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unreachable

The database encountered unreachable logic

§

Deprecated(String)

Statement has been deprecated

§

Thrown(String)

A custom error has been thrown

§

Ds(String)

There was a problem with the underlying datastore

§

Tx(String)

There was a problem with a datastore transaction

§

TxFailure

There was an error when starting a new datastore transaction

§

TxFinished

The transaction was already cancelled or committed

§

TxReadonly

The current transaction was created as read-only

§

TxConditionNotMet

The conditional value in the request was not equal

§

TxKeyAlreadyExists

👎Deprecated: Use TxKeyAlreadyExistsCategory

The key being inserted in the transaction already exists

§

TxKeyTooLarge

The key exceeds a limit set by the KV store

§

TxValueTooLarge

The value exceeds a limit set by the KV store

§

TxTooLarge

The transaction writes too much data for the KV store

§

NsEmpty

No namespace has been selected

§

DbEmpty

No database has been selected

§

QueryEmpty

No SQL query has been specified

§

QueryRemaining

There was an error with the SQL query

§

InvalidQuery(RenderedError)

There was an error with the SQL query

§

InvalidContent

There was an error with the SQL query

Fields

§value: Value
§

InvalidMerge

There was an error with the SQL query

Fields

§value: Value
§

InvalidPatch

There was an error with the provided JSON Patch

Fields

§message: String
§

PatchTest

Given test operation failed for JSON Patch

Fields

§expected: String
§

HttpDisabled

Remote HTTP request functions are not enabled

§

InvalidParam

it is not possible to set a variable with the specified name

Fields

§name: String
§

InvalidField

Fields

§line: usize
§field: String
§

InvalidSplit

Fields

§line: usize
§field: String
§

InvalidOrder

Fields

§line: usize
§field: String
§

InvalidGroup

Fields

§line: usize
§field: String
§

InvalidLimit

The LIMIT clause must evaluate to a positive integer

Fields

§value: String
§

InvalidStart

The START clause must evaluate to a positive integer

Fields

§value: String
§

InvalidScript

There was an error with the provided JavaScript code

Fields

§message: String
§

InvalidFunction

There was a problem running the specified function

Fields

§name: String
§message: String
§

InvalidArguments

The wrong quantity or magnitude of arguments was given for the specified function

Fields

§name: String
§message: String
§

InvalidUrl(String)

The URL is invalid

§

InvalidVectorDimension

The size of the vector is incorrect

Fields

§current: usize
§expected: usize
§

InvalidVectorDistance

The size of the vector is incorrect

Fields

§left: Arc<Vector>
§right: Arc<Vector>
§dist: f64
§

InvalidVectorType

The size of the vector is incorrect

Fields

§current: String
§expected: &'static str
§

InvalidVectorValue

The size of the vector is incorrect

Fields

§current: String
§

InvalidRegex(String)

Invalid regular expression

§

QueryTimedout

The query timedout

§

QueryCancelled

The query did not execute, because the transaction was cancelled

§

QueryNotExecuted

The query did not execute, because the transaction has failed

§

QueryNotExecutedDetail

The query did not execute, because the transaction has failed (with a message)

Fields

§message: String
§

NsNotAllowed

The permissions do not allow for changing to the specified namespace

Fields

§

DbNotAllowed

The permissions do not allow for changing to the specified database

Fields

§

NsNotFound

The requested namespace does not exist

Fields

§value: String
§

NtNotFound

The requested namespace token does not exist

Fields

§value: String
§

NlNotFound

The requested namespace login does not exist

Fields

§value: String
§

DbNotFound

The requested database does not exist

Fields

§value: String
§

DtNotFound

The requested database token does not exist

Fields

§value: String
§

DlNotFound

The requested database login does not exist

Fields

§value: String
§

FcNotFound

The requested function does not exist

Fields

§value: String
§

ScNotFound

The requested scope does not exist

Fields

§value: String
§

ClAlreadyExists

Fields

§value: String
§

NdNotFound

Fields

§value: String
§

StNotFound

The requested scope token does not exist

Fields

§value: String
§

PaNotFound

The requested param does not exist

Fields

§value: String
§

TbNotFound

The requested table does not exist

Fields

§value: String
§

LvNotFound

The requested live query does not exist

Fields

§value: String
§

LqNotFound

The requested cluster live query does not exist

Fields

§value: String
§

AzNotFound

The requested analyzer does not exist

Fields

§value: String
§

IxNotFound

The requested analyzer does not exist

Fields

§value: String
§

UnsupportedDistance(Distance)

§

UserRootNotFound

The requested root user does not exist

Fields

§value: String
§

UserNsNotFound

The requested namespace user does not exist

Fields

§value: String
§

UserDbNotFound

The requested database user does not exist

Fields

§value: String
§

RealtimeDisabled

Unable to perform the realtime query

§

ComputationDepthExceeded

Reached excessive computation depth due to functions, subqueries, or futures

§

InvalidStatementTarget

Can not execute statement using the specified value

Fields

§value: String
§

CreateStatement

Can not execute CREATE statement using the specified value

Fields

§value: String
§

UpdateStatement

Can not execute UPDATE statement using the specified value

Fields

§value: String
§

RelateStatement

Can not execute RELATE statement using the specified value

Fields

§value: String
§

DeleteStatement

Can not execute DELETE statement using the specified value

Fields

§value: String
§

InsertStatement

Can not execute INSERT statement using the specified value

Fields

§value: String
§

LiveStatement

Can not execute LIVE statement using the specified value

Fields

§value: String
§

KillStatement

Can not execute KILL statement using the specified id

Fields

§value: String
§

SingleOnlyOutput

Can not execute CREATE statement using the specified value

§

TablePermissions

The permissions do not allow this query to be run on this table

Fields

§table: String
§

ParamPermissions

The permissions do not allow this query to be run on this table

Fields

§name: String
§

FunctionPermissions

The permissions do not allow this query to be run on this table

Fields

§name: String
§

TableIsView

The specified table can not be written as it is setup as a foreign table view

Fields

§table: String
§

RecordExists

A database entry for the specified record already exists

Fields

§thing: String
§

IndexExists

A database index entry for the specified record already exists

Fields

§thing: Thing
§index: String
§value: String
§

FieldCheck

The specified field did not conform to the field type check

Fields

§thing: String
§value: String
§field: Idiom
§check: String
§

FieldValue

The specified field did not conform to the field ASSERT clause

Fields

§thing: String
§value: String
§field: Idiom
§check: String
§

IdMismatch

Found a record id for the record but we are creating a specific record

Fields

§value: String
§

IdInvalid

Found a record id for the record but this is not a valid id

Fields

§value: String
§

CoerceTo

Unable to coerce to a value to another value

Fields

§from: Value
§into: String
§

ConvertTo

Unable to convert a value to another value

Fields

§from: Value
§into: String
§

LengthInvalid

Unable to coerce to a value to another value

Fields

§kind: String
§size: usize
§

TryAdd(String, String)

Cannot perform addition

§

TrySub(String, String)

Cannot perform subtraction

§

TryMul(String, String)

Cannot perform multiplication

§

TryDiv(String, String)

Cannot perform division

§

TryRem(String, String)

Cannot perform remainder

§

TryPow(String, String)

Cannot perform power

§

TryNeg(String)

Cannot perform negation

§

TryFrom(String, &'static str)

It’s is not possible to convert between the two types

§

Http(String)

There was an error processing a remote HTTP request

§

Channel(String)

There was an error processing a value in parallel

§

Io(Error)

Represents an underlying error with IO encoding / decoding

§

Encode(Error)

Represents an error when encoding a key-value entry

§

Decode(Error)

Represents an error when decoding a key-value entry

§

Revision(Error)

Represents an underlying error with versioned data encoding / decoding

§

CorruptedIndex

The index has been found to be inconsistent

§

NoIndexFoundForMatch

The query planner did not find an index able to support the match @@ or knn <> operator for a given expression

Fields

§value: String
§

AnalyzerError(String)

Represents an error when analyzing a value

§

HighlightError(String)

Represents an error when trying to highlight a value

§

Bincode(Error)

Represents an underlying error with Bincode serializing / deserializing

§

FstError(Error)

Represents an underlying error with FST

§

Utf8Error(FromUtf8Error)

Represents an underlying error while reading UTF8 characters

§

FeatureNotYetImplemented

The feature has not yet being implemented

Fields

§feature: String
§

DuplicatedMatchRef

Duplicated match references are not allowed

Fields

§mr: u8
§

TimestampOverflow(String)

Represents a failure in timestamp arithmetic related to database internals

§

Internal(String)

Internal server error This should be used extremely sporadically, since we lose the type of error as a consequence There will be times when it is useful, such as with unusual type conversion errors

§

Unimplemented(String)

Unimplemented functionality

§

CorruptedVersionstampInKey(Error)

§

InvalidLevel(String)

Invalid level

§

IamError(Error)

Represents an underlying IAM error

§

ScriptingNotAllowed

Scripting is not allowed

§

FunctionNotAllowed(String)

Function is not allowed

§

NetTargetNotAllowed(String)

Network target is not allowed

§

TokenMakingFailed

§

NoRecordFound

§

SignupQueryFailed

§

SigninQueryFailed

§

ScopeNoSignup

§

ScopeNoSignin

§

NoScopeFound

§

MissingUserOrPass

§

NoSigninTarget

§

InvalidPass

§

InvalidAuth

There was an error with authentication

§

InvalidSignup

There was an error with signing up

§

UnknownAuth

Auth was expected to be set but was unknown

§

TxKeyAlreadyExistsCategory(KeyCategory)

The key being inserted in the transaction already exists

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn custom<T>(msg: T) -> Self
where T: Display,

Used when a Serialize implementation encounters any error while serializing a type. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Box<ErrorKind>> for Error

Source§

fn from(source: BincodeError) -> Self

Converts to this type from the input type.
Source§

impl From<CaughtError<'_>> for Error

Source§

fn from(e: CaughtError<'_>) -> Error

Converts to this type from the input type.
Source§

impl From<DecodeError> for Error

Source§

fn from(_: Base64Error) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: IoError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: EncodeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Db) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: RevisionError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: FstError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: IamError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(_: JWTError) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for String

Source§

fn from(e: Error) -> String

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for Error

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<RecvError> for Error

Source§

fn from(e: RecvError) -> Error

Converts to this type from the input type.
Source§

impl<T> From<SendError<T>> for Error

Source§

fn from(e: SendError<T>) -> Error

Converts to this type from the input type.
Source§

impl Serialize for Error

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool

Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> ParallelSend for T
where T: Send,