SupabaseErrorRegistry class abstract

Abstract error registry for Supabase-specific error handling

Implement this class to provide custom error mappings for your Supabase integration. This follows the same pattern as ErrorRegistry for Dio.

Example:

class MySupabaseErrorRegistry extends SupabaseErrorRegistry {
  @override
  SupabaseAuthErrorRegistry get authErrorRegistry => {
    'invalid_credentials': (e) => const InvalidCredentialsFailure(),
    'user_not_found': (e) => const UserNotFoundFailure(),
  };

  @override
  SupabaseStatusCodeRegistry get postgrestStatusRegistry => {
    404: (error, message, statusCode) => const Left(NotFoundFailure()),
    409: (error, message, statusCode) => const Left(ConflictFailure()),
  };

  @override
  Failure get genericError => const GenericSupabaseFailure();
}

Constructors

SupabaseErrorRegistry()

Properties

authErrorRegistry SupabaseAuthErrorRegistry
Returns the mapping for AuthException error codes to failures
no setter
functionErrorRegistry SupabaseFunctionErrorRegistry
Returns the mapping for FunctionException status codes to failures
no setter
generalErrorRegistry SupabaseGeneralErrorRegistry
Returns the mapping for general exception types to failures
no setter
genericError Failure
Returns the default failure for unhandled cases
no setter
hashCode int
The hash code for this object.
no setterinherited
postgrestErrorCodeRegistry SupabaseErrorCodeRegistry
Returns the mapping for PostgrestException error codes to failures
no setter
postgrestStatusRegistry SupabaseStatusCodeRegistry
Returns the mapping for PostgrestException HTTP status codes to failures
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storageErrorRegistry SupabaseStorageErrorRegistry
Returns the mapping for StorageException error codes to failures
no setter

Methods

handleRealtimeError(Object error) Failure?
Optional: Override to provide custom handling for realtime errors
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited