supabase_auth_redux/
error.rs

1#![allow(missing_docs)]
2
3use kinded::Kinded;
4use thiserror::Error;
5
6/// Errors that can occur when interacting with the Supabase Auth API
7#[derive(Debug, Default, Clone, Copy, Error, Kinded)]
8#[non_exhaustive]
9pub enum AuthError {
10    /// User is not authorized to perform the requested operation
11    #[error("not authorized")]
12    NotAuthorized,
13
14    /// Invalid parameters provided to the API
15    #[error("invalid parameters")]
16    InvalidParameters,
17
18    /// HTTP communication error
19    #[error("http error")]
20    Http,
21
22    /// Internal library error (e.g., JSON parsing)
23    #[error("internal library error")]
24    Internal,
25
26    /// Requested resource was not found
27    #[error("resource not found")]
28    NotFound,
29
30    /// Service role key is required for admin operations
31    #[error("service role key required for admin operations")]
32    ServiceRoleKeyRequired,
33
34    /// General authentication error
35    #[error("general gotrue error")]
36    #[default]
37    GeneralError,
38}