pub enum Error {
Show 18 variants
Http {
message: String,
source: Option<Error>,
context: ErrorContext,
},
Json(Error),
UrlParse(ParseError),
Jwt(Error),
Auth {
message: String,
context: ErrorContext,
},
Database {
message: String,
context: ErrorContext,
},
Storage {
message: String,
context: ErrorContext,
},
Realtime {
message: String,
context: ErrorContext,
},
Config {
message: String,
},
InvalidInput {
message: String,
},
Network {
message: String,
context: ErrorContext,
},
RateLimit {
message: String,
context: ErrorContext,
},
PermissionDenied {
message: String,
context: ErrorContext,
},
NotFound {
message: String,
context: ErrorContext,
},
Generic {
message: String,
},
Functions {
message: String,
context: ErrorContext,
},
Platform {
message: String,
context: ErrorContext,
},
Crypto {
message: String,
context: ErrorContext,
},
}
Expand description
Main error type for Supabase operations
Variants§
Http
HTTP request errors with enhanced context
Json(Error)
JSON serialization/deserialization errors
UrlParse(ParseError)
URL parsing errors
Jwt(Error)
JWT token errors
Auth
Authentication errors with enhanced context
Database
Database operation errors with enhanced context
Storage
Storage operation errors with enhanced context
Realtime
Realtime connection errors with enhanced context
Config
Configuration errors
InvalidInput
Invalid input errors
Network
Network errors with enhanced context
RateLimit
Rate limiting errors with retry information
PermissionDenied
Permission denied errors with enhanced context
NotFound
Resource not found errors with enhanced context
Generic
Generic errors
Functions
Functions errors with enhanced context
Platform
Platform-specific error
Crypto
Cryptographic error
Implementations§
Source§impl Error
impl Error
Sourcepub fn auth<S: Into<String>>(message: S) -> Self
pub fn auth<S: Into<String>>(message: S) -> Self
Create an authentication error with enhanced context
Sourcepub fn auth_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn auth_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create an authentication error with custom context
Sourcepub fn database<S: Into<String>>(message: S) -> Self
pub fn database<S: Into<String>>(message: S) -> Self
Create a database error with enhanced context
Sourcepub fn database_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn database_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create a database error with custom context
Sourcepub fn storage<S: Into<String>>(message: S) -> Self
pub fn storage<S: Into<String>>(message: S) -> Self
Create a storage error with enhanced context
Sourcepub fn storage_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn storage_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create a storage error with custom context
Sourcepub fn realtime<S: Into<String>>(message: S) -> Self
pub fn realtime<S: Into<String>>(message: S) -> Self
Create a realtime error with enhanced context
Sourcepub fn realtime_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn realtime_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create a realtime error with custom context
Sourcepub fn functions<S: Into<String>>(message: S) -> Self
pub fn functions<S: Into<String>>(message: S) -> Self
Create a functions error with enhanced context
Sourcepub fn functions_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn functions_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create a functions error with custom context
Sourcepub fn network<S: Into<String>>(message: S) -> Self
pub fn network<S: Into<String>>(message: S) -> Self
Create a network error with enhanced context
Sourcepub fn rate_limit<S: Into<String>>(message: S, retry_after: Option<u64>) -> Self
pub fn rate_limit<S: Into<String>>(message: S, retry_after: Option<u64>) -> Self
Create a rate limit error with retry information
Sourcepub fn permission_denied<S: Into<String>>(message: S) -> Self
pub fn permission_denied<S: Into<String>>(message: S) -> Self
Create a permission denied error with enhanced context
Sourcepub fn not_found<S: Into<String>>(message: S) -> Self
pub fn not_found<S: Into<String>>(message: S) -> Self
Create a not found error with enhanced context
Sourcepub fn invalid_input<S: Into<String>>(message: S) -> Self
pub fn invalid_input<S: Into<String>>(message: S) -> Self
Create an invalid input error
Sourcepub fn context(&self) -> Option<&ErrorContext>
pub fn context(&self) -> Option<&ErrorContext>
Get error context if available
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn retry_after(&self) -> Option<u64>
pub fn retry_after(&self) -> Option<u64>
Get retry delay in seconds
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Get HTTP status code if available
Sourcepub fn platform_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn platform_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create a platform error with context
Sourcepub fn crypto_with_context<S: Into<String>>(
message: S,
context: ErrorContext,
) -> Self
pub fn crypto_with_context<S: Into<String>>( message: S, context: ErrorContext, ) -> Self
Create a cryptographic error with context
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for SupabaseError
impl From<Error> for SupabaseError
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> 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> 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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.