pub struct SupabaseError {
kind: SupabaseErrorKind,
}Expand description
Failure returned by the Supabase client.
Fields§
§kind: SupabaseErrorKindImplementations§
Source§impl SupabaseError
impl SupabaseError
Sourcepub fn server(status: u16, message: impl Into<String>) -> Self
pub fn server(status: u16, message: impl Into<String>) -> Self
Creates an HTTP-status error with its response body.
pub(crate) fn decode( url: impl Into<String>, body: impl Into<String>, source: Error, ) -> Self
pub(crate) fn env_var(name: impl Into<String>, source: VarError) -> Self
pub(crate) fn client_build(source: Error) -> Self
pub(crate) fn rate_limited(retry_after_ms: u64) -> Self
fn new(kind: SupabaseErrorKind) -> Self
Sourcepub fn env_var_name(&self) -> Option<&str>
pub fn env_var_name(&self) -> Option<&str>
Returns the missing environment variable’s name, when applicable.
Sourcepub fn server_status(&self) -> Option<u16>
pub fn server_status(&self) -> Option<u16>
Returns the rejected HTTP status code, when applicable.
Sourcepub fn response_body(&self) -> Option<&str>
pub fn response_body(&self) -> Option<&str>
Returns the server response body or the retained JSON-decode preview, when applicable.
Sourcepub fn retry_after_ms(&self) -> Option<u64>
pub fn retry_after_ms(&self) -> Option<u64>
Returns the server-requested retry delay in milliseconds, when rate limited.
pub(crate) fn is_retryable(&self) -> bool
Trait Implementations§
Source§impl Debug for SupabaseError
impl Debug for SupabaseError
Source§impl Display for SupabaseError
impl Display for SupabaseError
Source§impl Error for SupabaseError
impl Error for SupabaseError
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 SupabaseError
impl From<Error> for SupabaseError
Auto Trait Implementations§
impl Freeze for SupabaseError
impl !RefUnwindSafe for SupabaseError
impl Send for SupabaseError
impl Sync for SupabaseError
impl Unpin for SupabaseError
impl UnsafeUnpin for SupabaseError
impl !UnwindSafe for SupabaseError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SpecConfig for T
impl<T> SpecConfig for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§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 more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.