Last active
April 12, 2023 01:11
-
-
Save erenkeskin/26e1481aec4016c01e6cc053f12ab8a9 to your computer and use it in GitHub Desktop.
Using Firebase with error handler, you can check your error.code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const firebaseErrorMessages = { | |
// Auth Errors | |
'auth/admin-restricted-operation': 'Admin restricted operation', | |
'auth/argument-error': 'Argument error', | |
'auth/app-not-authorized': 'App not authorized', | |
'auth/app-not-installed': 'App not installed', | |
'auth/captcha-check-failed': 'Captcha check failed', | |
'auth/code-expired': 'Code expired', | |
'auth/cordova-not-ready': 'Cordova not ready', | |
'auth/cors-unsupported': 'CORS unsupported', | |
'auth/credential-already-in-use': 'Credential already in use', | |
'auth/custom-token-mismatch': 'Credential mismatch', | |
'auth/requires-recent-login': 'Credential too old, login again', | |
'auth/dynamic-link-not-activated': 'Dynamic link not activated', | |
'auth/email-change-needs-verification': 'Email change needs verification', | |
'auth/emulator-config-failed': 'Emulator config failed', | |
'auth/expired-action-code': 'Expired action code', | |
'auth/cancelled-popup-request': 'Expired popup request', | |
'auth/invalid-api-key': 'Invalid API key', | |
'auth/invalid-app-credential': 'Invalid app credential', | |
'auth/invalid-app-id': 'Invalid app ID', | |
'auth/invalid-user-token': 'Invalid auth', | |
'auth/invalid-auth-event': 'Invalid auth event', | |
'auth/invalid-cert-hash': 'Invalid cert hash', | |
'auth/invalid-continue-uri': 'Invalid continue URI', | |
'auth/invalid-cordova-configuration': 'Invalid Cordova configuration', | |
'auth/invalid-dynamic-link-domain': 'Invalid dynamic link domain', | |
'auth/invalid-emulator-scheme': 'Invalid emulator scheme', | |
'auth/invalid-email': 'Invalid email', | |
'auth/invalid-credential': 'Invalid IDP response', | |
'auth/invalid-message-payload': 'Invalid message payload', | |
'auth/invalid-multi-factor-session': 'Invalid multi-factor session', | |
'auth/invalid-oauth-client-id': 'Invalid OAuth client ID', | |
'auth/invalid-oauth-provider': 'Invalid OAuth provider', | |
'auth/invalid-action-code': 'Invalid OOB code', | |
'auth/unauthorized-domain': 'Invalid origin', | |
'auth/wrong-password': 'Invalid password', | |
'auth/invalid-persistence-type': 'Invalid persistence', | |
'auth/invalid-phone-number': 'Invalid phone number', | |
'auth/invalid-provider-id': 'Invalid provider ID', | |
'auth/invalid-recipient-email': 'Invalid recipient email', | |
'auth/invalid-sender': 'Invalid sender', | |
'auth/invalid-verification-id': 'Invalid session info', | |
'auth/invalid-tenant-id': 'Invalid tenant ID', | |
'auth/multi-factor-info-not-found': 'MFA info not found', | |
'auth/multi-factor-auth-required': 'MFA required', | |
'auth/missing-android-pkg-name': 'Missing Android package name', | |
'auth/missing-app-credential': 'Missing app credential', | |
'auth/auth-domain-config-required': 'Missing auth domain', | |
'auth/missing-verification-code': 'Missing code', | |
'auth/missing-continue-uri': 'Missing continue URI', | |
'auth/missing-iframe-start': 'Missing iframe start', | |
'auth/missing-ios-bundle-id': 'Missing iOS bundle ID', | |
'auth/missing-or-invalid-nonce': 'Missing or invalid nonce', | |
'auth/missing-multi-factor-info': 'Missing multi-factor info', | |
'auth/missing-multi-factor-session': 'Missing multi-factor session', | |
'auth/missing-phone-number': 'Missing phone number', | |
'auth/missing-verification-id': 'Missing session info', | |
'auth/missing-password': 'Missing password', | |
'auth/app-deleted': 'Module destroyed', | |
'auth/account-exists-with-different-credential': 'Need confirmation', | |
'auth/network-request-failed': 'Network request failed', | |
'auth/null-user': 'Null user', | |
'auth/no-auth-event': 'No auth event', | |
'auth/no-such-provider': 'No such provider', | |
'auth/operation-not-allowed': 'Operation not allowed', | |
'auth/operation-not-supported-in-this-environment': 'Operation not supported', | |
'auth/popup-blocked': 'Popup blocked', | |
'auth/popup-closed-by-user': 'Popup closed by user', | |
'auth/provider-already-linked': 'Provider already linked', | |
'auth/quota-exceeded': 'Quota exceeded', | |
'auth/redirect-cancelled-by-user': 'Redirect cancelled by user', | |
'auth/redirect-operation-pending': 'Redirect operation pending', | |
'auth/rejected-credential': 'Rejected credential', | |
'auth/second-factor-already-in-use': 'Second factor already enrolled', | |
'auth/maximum-second-factor-count-exceeded': 'Second factor limit exceeded', | |
'auth/tenant-id-mismatch': 'Tenant ID mismatch', | |
'auth/timeout': 'Timeout', | |
'auth/user-token-expired': 'Token expired', | |
'auth/too-many-requests': 'Too many attempts, try later', | |
'auth/unauthorized-continue-uri': 'Unauthorized domain', | |
'auth/unsupported-first-factor': 'Unsupported first factor', | |
'auth/unsupported-persistence-type': 'Unsupported persistence', | |
'auth/unsupported-tenant-operation': 'Unsupported tenant operation', | |
'auth/unverified-email': 'Unverified email', | |
'auth/user-cancelled': 'User cancelled', | |
'auth/user-not-found': 'User not found', | |
'auth/user-disabled': 'User disabled', | |
'auth/user-mismatch': 'User mismatch', | |
'auth/user-signed-out': 'User signed out', | |
'auth/weak-password': 'Weak password', | |
'auth/web-storage-unsupported': 'Web storage unsupported', | |
'auth/already-initialized': 'Already initialized', | |
// Firestore Errors | |
'firestore/aborted': 'The operation was aborted', | |
'firestore/already-exists': 'Document already exists', | |
'firestore/cancelled': 'The operation was cancelled', | |
'firestore/data-loss': 'Unrecoverable data loss or corruption', | |
'firestore/deadline-exceeded': 'Deadline expired before operation could complete', | |
'firestore/failed-precondition': 'System not in a state required for the operation', | |
'firestore/internal': 'Internal errors', | |
'firestore/invalid-argument': 'Client specified an invalid argument', | |
'firestore/not-found': 'Requested document was not found', | |
'firestore/ok': 'The operation completed successfully', | |
'firestore/out-of-range': 'Operation attempted past the valid range', | |
'firestore/permission-denied': 'Caller does not have permission to execute operation', | |
'firestore/resource-exhausted': 'Resource has been exhausted', | |
'firestore/unauthenticated': 'Request does not have valid authentication credentials', | |
'firestore/unavailable': 'The service is currently unavailable', | |
'firestore/unimplemented': 'Operation is not implemented or not supported/enabled', | |
'firestore/unknown': 'Unknown error or an error from a different error domain', | |
// Storage Errors | |
'storage/unknown': 'Unknown error occurred', | |
'storage/object-not-found': 'Object not found', | |
'storage/bucket-not-found': 'Bucket not found', | |
'storage/project-not-found': 'Project not found', | |
'storage/quota-exceeded': 'Quota exceeded', | |
'storage/unauthenticated': 'User is unauthenticated', | |
'storage/unauthorized': 'User is not authorized to perform this action', | |
'storage/retry-limit-exceeded': 'Retry limit exceeded', | |
'storage/cancelled': 'Operation cancelled', | |
'storage/invalid-checksum': 'Invalid checksum', | |
// Realtime Database Errors | |
'database/invalid-permission-denied': 'Permission denied.', | |
'database/unauthenticated': 'Unauthenticated request.', | |
'database/maximum-retries': 'Maximum retries reached.', | |
'database/invalid-data': 'Invalid data.', | |
'database/write-throttled': 'Write throttled.', | |
'database/resource-exhausted': 'Resource exhausted.', | |
'database/unknown-error': 'An unknown error occurred.', | |
'database/network-error': 'Network error.', | |
'database/transaction-aborted': 'Transaction aborted.', | |
'database/permission-denied': 'Permission denied.', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment