pub enum Error {
Show 64 variants
DbConnection(String),
UnsupportedPgVersion {
major: u32,
minor: u32,
},
InvalidConfig {
message: String,
},
ConnectionRetryTimeout,
InvalidQueryParam {
param: String,
message: String,
},
ParseError {
location: String,
message: String,
},
InvalidRange(String),
InvalidContentType(String),
InvalidPreference(String),
InvalidFilterOperator {
column: String,
op: String,
},
AmbiguousEmbedding(String),
InvalidEmbedding(String),
InvalidBody(String),
SchemaNotFound(String),
InvalidSpreadColumn(String),
InvalidMediaHandler(String),
MediaTypeMismatch(String),
UriTooLong(String),
InvalidAggregate(String),
GucHeadersError,
GucStatusError,
PutLimitNotAllowed,
PutMatchingPkError,
SingularityError {
count: i64,
},
UnsupportedMethod(String),
RelatedOrderNotToOne {
origin: String,
target: String,
},
UnacceptableFilter {
target: String,
},
DbrstParseError(String),
InvalidPreferencesStrict(String),
AggregatesNotAllowed,
MaxAffectedViolation {
count: i64,
},
InvalidResourcePath,
OpenApiDisabled,
NotImplemented(String),
MaxAffectedRpcViolation,
TableNotFound {
name: String,
suggestion: Option<String>,
},
ColumnNotFound {
table: String,
column: String,
},
FunctionNotFound {
name: String,
},
RelationshipNotFound {
from_table: String,
to_table: String,
},
SchemaCacheNotReady,
AmbiguousRelationship {
from_table: String,
to_table: String,
},
AmbiguousFunction {
name: String,
},
JwtAuth(JwtError),
Jwt(String),
NoAnonRole,
PermissionDenied {
role: String,
},
NotInsertable {
table: String,
},
NotUpdatable {
table: String,
},
NotDeletable {
table: String,
},
SingleObjectExpected,
MissingPayload,
InvalidPayload(String),
NoPrimaryKey {
table: String,
},
PutIncomplete,
Database {
code: Option<String>,
message: String,
detail: Option<String>,
hint: Option<String>,
},
ForeignKeyViolation(String),
UniqueViolation(String),
CheckViolation(String),
NotNullViolation(String),
ExclusionViolation(String),
MaxRowsExceeded {
count: i64,
max: i64,
},
RaisedException {
message: String,
status: Option<u16>,
},
DbrstRaise {
message: String,
status: u16,
},
Internal(String),
}Expand description
Main error type for dbrest
Each variant maps to a specific DBRST error code and HTTP status code.
Variants§
DbConnection(String)
UnsupportedPgVersion
InvalidConfig
ConnectionRetryTimeout
InvalidQueryParam
ParseError
InvalidRange(String)
InvalidContentType(String)
InvalidPreference(String)
InvalidFilterOperator
AmbiguousEmbedding(String)
InvalidEmbedding(String)
InvalidBody(String)
SchemaNotFound(String)
InvalidSpreadColumn(String)
InvalidMediaHandler(String)
MediaTypeMismatch(String)
UriTooLong(String)
InvalidAggregate(String)
GucHeadersError
GucStatusError
PutLimitNotAllowed
PutMatchingPkError
SingularityError
UnsupportedMethod(String)
RelatedOrderNotToOne
UnacceptableFilter
DbrstParseError(String)
InvalidPreferencesStrict(String)
AggregatesNotAllowed
MaxAffectedViolation
InvalidResourcePath
OpenApiDisabled
NotImplemented(String)
MaxAffectedRpcViolation
TableNotFound
ColumnNotFound
FunctionNotFound
RelationshipNotFound
SchemaCacheNotReady
AmbiguousRelationship
AmbiguousFunction
JwtAuth(JwtError)
Jwt(String)
NoAnonRole
PermissionDenied
NotInsertable
NotUpdatable
NotDeletable
SingleObjectExpected
MissingPayload
InvalidPayload(String)
NoPrimaryKey
PutIncomplete
Database
ForeignKeyViolation(String)
UniqueViolation(String)
CheckViolation(String)
NotNullViolation(String)
ExclusionViolation(String)
MaxRowsExceeded
RaisedException
DbrstRaise
Internal(String)
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<&Error> for ErrorResponse
impl From<&Error> for ErrorResponse
Source§impl From<ConfigError> for Error
Convert ConfigError to the main Error type
impl From<ConfigError> for Error
Convert ConfigError to the main Error type
Source§fn from(err: ConfigError) -> Self
fn from(err: ConfigError) -> Self
Converts to this type from the input type.
Source§impl IntoResponse for Error
impl IntoResponse for Error
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more