TurboExceptionHandler mixin

A mixin that provides Firebase Authentication exception handling.

Provides a standardized way to handle Firebase Authentication exceptions by converting them into user-friendly TurboResponse objects with:

  • Appropriate error titles
  • Descriptive error messages
  • Original error details for debugging

Usage:

class AuthService with TurboExceptionHandler {
  Future<TurboResponse<UserCredential>> signIn() async {
    try {
      // Sign in code...
    } on FirebaseAuthException catch (e) {
      return tryHandleFirebaseAuthException(
        firebaseAuthException: e,
        log: log,
      );
    }
  }
}
Mixin applications

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
tryHandleFirebaseAuthException<T>({required FirebaseAuthException firebaseAuthException, required Log log}) → TurboResponse<T>
Handles Firebase Authentication exceptions and converts them to TurboResponse.

Operators

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