friendlyErrorMessage property

String get friendlyErrorMessage

Gets a user-friendly error message

Implementation

String get friendlyErrorMessage {
  if (success) return 'Authentication successful';

  if (isCancelled) {
    return 'Authentication was cancelled';
  }

  if (isNetworkError) {
    return 'Network error occurred. Please check your connection and try again.';
  }

  if (isTokenError) {
    return 'Authentication failed. Please try logging in again.';
  }

  if (isConfigurationError) {
    return 'Configuration error. Please contact support.';
  }

  return error?.message ?? 'An unknown error occurred';
}