SupabaseNetworkHandler class
A handler for safely executing Supabase operations with centralized error handling.
This follows the same pattern as SimpleNetworkHandler but is designed specifically for Supabase exceptions (AuthException, PostgrestException, StorageException, FunctionException, etc.).
Usage:
// Initialize once at app startup
SupabaseNetworkHandler.setErrorRegistry(MySupabaseErrorRegistry());
// Use in repositories
Future<Either<Failure, User>> getCurrentUser() {
return SupabaseNetworkHandler.safeCall(
() => supabase.auth.getUser(),
);
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Methods
-
safeCall<
T> (Future< T> request(), {Either<Failure, T> ? onError(Object error)?}) → Future<Either< Failure, T> > - Safely executes a Supabase operation and returns an Either result.
-
setDebugLogging(
bool enabled) → void - Enables or disables debug logging for Supabase errors.
-
setErrorRegistry(
SupabaseErrorRegistry registry) → void - Sets the error registry for Supabase error handling.