diff --git a/etc/firebase-admin.app.api.md b/etc/firebase-admin.app.api.md index a6ad65cd57..4546fe7824 100644 --- a/etc/firebase-admin.app.api.md +++ b/etc/firebase-admin.app.api.md @@ -14,6 +14,32 @@ export interface App { options: AppOptions; } +// @public +export class AppErrorCodes { + // (undocumented) + static APP_DELETED: string; + // (undocumented) + static DUPLICATE_APP: string; + // (undocumented) + static INTERNAL_ERROR: string; + // (undocumented) + static INVALID_APP_NAME: string; + // (undocumented) + static INVALID_APP_OPTIONS: string; + // (undocumented) + static INVALID_ARGUMENT: string; + // (undocumented) + static INVALID_CREDENTIAL: string; + // (undocumented) + static NETWORK_ERROR: string; + // (undocumented) + static NETWORK_TIMEOUT: string; + // (undocumented) + static NO_APP: string; + // (undocumented) + static UNABLE_TO_PARSE_RESPONSE: string; +} + // @public export function applicationDefault(httpAgent?: Agent): Credential; @@ -39,6 +65,12 @@ export interface Credential { // @public export function deleteApp(app: App): Promise; +// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseAppError extends PrefixedFirebaseError { +} + // @public export interface FirebaseArrayIndexError { error: FirebaseError; diff --git a/etc/firebase-admin.auth.api.md b/etc/firebase-admin.auth.api.md index 3723abd051..d921458bec 100644 --- a/etc/firebase-admin.auth.api.md +++ b/etc/firebase-admin.auth.api.md @@ -55,6 +55,480 @@ export class Auth extends BaseAuth { tenantManager(): TenantManager; } +// @public +export class AuthClientErrorCode { + // (undocumented) + static AUTH_BLOCKING_TOKEN_EXPIRED: { + code: string; + message: string; + }; + // (undocumented) + static BILLING_NOT_ENABLED: { + code: string; + message: string; + }; + // (undocumented) + static CLAIMS_TOO_LARGE: { + code: string; + message: string; + }; + // (undocumented) + static CONFIGURATION_EXISTS: { + code: string; + message: string; + }; + // (undocumented) + static CONFIGURATION_NOT_FOUND: { + code: string; + message: string; + }; + // (undocumented) + static EMAIL_ALREADY_EXISTS: { + code: string; + message: string; + }; + // (undocumented) + static EMAIL_NOT_FOUND: { + code: string; + message: string; + }; + // (undocumented) + static FORBIDDEN_CLAIM: { + code: string; + message: string; + }; + // (undocumented) + static ID_TOKEN_EXPIRED: { + code: string; + message: string; + }; + // (undocumented) + static ID_TOKEN_REVOKED: { + code: string; + message: string; + }; + // (undocumented) + static INSUFFICIENT_PERMISSION: { + code: string; + message: string; + }; + // (undocumented) + static INTERNAL_ERROR: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_ARGUMENT: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_CLAIMS: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_CONFIG: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_CONTINUE_URI: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_CREATION_TIME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_CREDENTIAL: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_DISABLED_FIELD: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_DISPLAY_NAME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_DYNAMIC_LINK_DOMAIN: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_EMAIL: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_EMAIL_VERIFIED: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_ENROLLED_FACTORS: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_ENROLLMENT_TIME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_ALGORITHM: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_BLOCK_SIZE: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_DERIVED_KEY_LENGTH: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_KEY: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_MEMORY_COST: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_PARALLELIZATION: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_ROUNDS: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_HASH_SALT_SEPARATOR: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_ID_TOKEN: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_LAST_SIGN_IN_TIME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_NAME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_NEW_EMAIL: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_OAUTH_CLIENT_ID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_OAUTH_RESPONSETYPE: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PAGE_TOKEN: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PASSWORD: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PASSWORD_HASH: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PASSWORD_SALT: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PHONE_NUMBER: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PHOTO_URL: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PROJECT_ID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PROVIDER_DATA: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PROVIDER_ID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PROVIDER_UID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_RECAPTCHA_ACTION: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_RECAPTCHA_ENFORCEMENT_STATE: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_SESSION_COOKIE_DURATION: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_TENANT_ID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_TENANT_TYPE: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_TESTING_PHONE_NUMBER: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_TOKENS_VALID_AFTER_TIME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_UID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_USER_IMPORT: { + code: string; + message: string; + }; + // (undocumented) + static MAXIMUM_TEST_PHONE_NUMBER_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static MAXIMUM_USER_COUNT_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static MISMATCHING_TENANT_ID: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_ANDROID_PACKAGE_NAME: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_CONFIG: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_CONTINUE_URI: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_DISPLAY_NAME: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_EMAIL: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_HASH_ALGORITHM: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_IOS_BUNDLE_ID: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_ISSUER: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_OAUTH_CLIENT_ID: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_OAUTH_CLIENT_SECRET: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_PROVIDER_ID: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_SAML_RELYING_PARTY_CONFIG: { + code: string; + message: string; + }; + // (undocumented) + static MISSING_UID: { + code: string; + message: string; + }; + // (undocumented) + static NOT_FOUND: { + code: string; + message: string; + }; + // (undocumented) + static OPERATION_NOT_ALLOWED: { + code: string; + message: string; + }; + // (undocumented) + static PHONE_NUMBER_ALREADY_EXISTS: { + code: string; + message: string; + }; + // (undocumented) + static PROJECT_NOT_FOUND: { + code: string; + message: string; + }; + // (undocumented) + static QUOTA_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static RECAPTCHA_NOT_ENABLED: { + code: string; + message: string; + }; + // (undocumented) + static SECOND_FACTOR_LIMIT_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static SECOND_FACTOR_UID_ALREADY_EXISTS: { + code: string; + message: string; + }; + // (undocumented) + static SESSION_COOKIE_EXPIRED: { + code: string; + message: string; + }; + // (undocumented) + static SESSION_COOKIE_REVOKED: { + code: string; + message: string; + }; + // (undocumented) + static TENANT_NOT_FOUND: { + code: string; + message: string; + }; + // (undocumented) + static UID_ALREADY_EXISTS: { + code: string; + message: string; + }; + // (undocumented) + static UNAUTHORIZED_DOMAIN: { + code: string; + message: string; + }; + // (undocumented) + static UNSUPPORTED_FIRST_FACTOR: { + code: string; + message: string; + }; + // (undocumented) + static UNSUPPORTED_SECOND_FACTOR: { + code: string; + message: string; + }; + // (undocumented) + static UNSUPPORTED_TENANT_OPERATION: { + code: string; + message: string; + }; + // (undocumented) + static UNVERIFIED_EMAIL: { + code: string; + message: string; + }; + // (undocumented) + static USER_DISABLED: { + code: string; + message: string; + }; + // (undocumented) + static USER_NOT_DISABLED: { + code: string; + message: string; + }; + // (undocumented) + static USER_NOT_FOUND: { + code: string; + message: string; + }; +} + // @public export type AuthFactorType = 'phone'; @@ -249,6 +723,12 @@ export interface EmailSignInProviderConfig { passwordRequired?: boolean; } +// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseAuthError extends PrefixedFirebaseError { +} + // @public export function getAuth(app?: App): Auth; diff --git a/etc/firebase-admin.database.api.md b/etc/firebase-admin.database.api.md index e2411ce4be..1778f75d51 100644 --- a/etc/firebase-admin.database.api.md +++ b/etc/firebase-admin.database.api.md @@ -30,6 +30,12 @@ export const enableLogging: typeof rtdb.enableLogging; export { EventType } +// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseDatabaseError extends FirebaseError { +} + // Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts // // @public diff --git a/etc/firebase-admin.firestore.api.md b/etc/firebase-admin.firestore.api.md index 80c0e5d9c3..8f29baeab3 100644 --- a/etc/firebase-admin.firestore.api.md +++ b/etc/firebase-admin.firestore.api.md @@ -102,6 +102,12 @@ export { FieldValue } export { Filter } +// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseFirestoreError extends FirebaseError { +} + export { Firestore } export { FirestoreDataConverter } diff --git a/etc/firebase-admin.installations.api.md b/etc/firebase-admin.installations.api.md index 4a4d11e06f..56496ef135 100644 --- a/etc/firebase-admin.installations.api.md +++ b/etc/firebase-admin.installations.api.md @@ -8,6 +8,12 @@ import { Agent } from 'http'; +// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseInstallationsError extends FirebaseError { +} + // Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts // // @public @@ -19,4 +25,28 @@ export class Installations { deleteInstallation(fid: string): Promise; } +// @public (undocumented) +export class InstallationsClientErrorCode { + // (undocumented) + static API_ERROR: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_ARGUMENT: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_INSTALLATION_ID: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PROJECT_ID: { + code: string; + message: string; + }; +} + ``` diff --git a/etc/firebase-admin.instance-id.api.md b/etc/firebase-admin.instance-id.api.md index 2e2a43f642..9c28852a2c 100644 --- a/etc/firebase-admin.instance-id.api.md +++ b/etc/firebase-admin.instance-id.api.md @@ -8,6 +8,12 @@ import { Agent } from 'http'; +// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseInstanceIdError extends FirebaseError { +} + // Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts // // @public @deprecated @@ -19,4 +25,15 @@ export class InstanceId { deleteInstanceId(instanceId: string): Promise; } +// Warning: (ae-forgotten-export) The symbol "InstallationsClientErrorCode" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class InstanceIdClientErrorCode extends InstallationsClientErrorCode { + // (undocumented) + static INVALID_INSTANCE_ID: { + code: string; + message: string; + }; +} + ``` diff --git a/etc/firebase-admin.messaging.api.md b/etc/firebase-admin.messaging.api.md index e9465a8e2d..4b8e6c1ed3 100644 --- a/etc/firebase-admin.messaging.api.md +++ b/etc/firebase-admin.messaging.api.md @@ -165,6 +165,12 @@ export interface FcmOptions { analyticsLabel?: string; } +// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseMessagingError extends PrefixedFirebaseError { +} + // Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts // // @public @@ -200,6 +206,105 @@ export class Messaging { unsubscribeFromTopic(registrationTokenOrTokens: string | string[], topic: string): Promise; } +// @public +export class MessagingClientErrorCode { + // (undocumented) + static AUTHENTICATION_ERROR: { + code: string; + message: string; + }; + // (undocumented) + static DEVICE_MESSAGE_RATE_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static INTERNAL_ERROR: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_ARGUMENT: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_DATA_PAYLOAD_KEY: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_OPTIONS: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PACKAGE_NAME: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_PAYLOAD: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_RECIPIENT: { + code: string; + message: string; + }; + // (undocumented) + static INVALID_REGISTRATION_TOKEN: { + code: string; + message: string; + }; + // (undocumented) + static MESSAGE_RATE_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static MISMATCHED_CREDENTIAL: { + code: string; + message: string; + }; + // (undocumented) + static PAYLOAD_SIZE_LIMIT_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static REGISTRATION_TOKEN_NOT_REGISTERED: { + code: string; + message: string; + }; + // (undocumented) + static SERVER_UNAVAILABLE: { + code: string; + message: string; + }; + // (undocumented) + static THIRD_PARTY_AUTH_ERROR: { + code: string; + message: string; + }; + // (undocumented) + static TOO_MANY_TOPICS: { + code: string; + message: string; + }; + // (undocumented) + static TOPICS_MESSAGE_RATE_EXCEEDED: { + code: string; + message: string; + }; + // (undocumented) + static UNKNOWN_ERROR: { + code: string; + message: string; + }; +} + // @public export interface MessagingConditionResponse { messageId: number; diff --git a/etc/firebase-admin.project-management.api.md b/etc/firebase-admin.project-management.api.md index 2b8d28297c..8f59f54642 100644 --- a/etc/firebase-admin.project-management.api.md +++ b/etc/firebase-admin.project-management.api.md @@ -43,6 +43,12 @@ export enum AppPlatform { PLATFORM_UNKNOWN = "PLATFORM_UNKNOWN" } +// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts +// +// @public +export class FirebaseProjectManagementError extends PrefixedFirebaseError { +} + // Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point index.d.ts // // @public @@ -79,6 +85,9 @@ export class ProjectManagement { shaCertificate(shaHash: string): ShaCertificate; } +// @public (undocumented) +export type ProjectManagementErrorCode = 'already-exists' | 'authentication-error' | 'internal-error' | 'invalid-argument' | 'invalid-project-id' | 'invalid-server-response' | 'not-found' | 'service-unavailable' | 'unknown-error'; + // @public export class ShaCertificate { readonly certType: ('sha1' | 'sha256'); diff --git a/src/utils/error.ts b/src/utils/error.ts index cdb7faef05..772d808a9a 100644 --- a/src/utils/error.ts +++ b/src/utils/error.ts @@ -35,11 +35,13 @@ interface ServerToClientCode { /** * Firebase error code structure. This extends Error. - * - * @param errorInfo - The error information (code and message). - * @constructor */ export class FirebaseError extends Error implements FirebaseErrorInterface { + /** + * @param errorInfo - The error information (code and message). + * @constructor + * @internal + */ constructor(private errorInfo: ErrorInfo) { super(errorInfo.message); @@ -71,13 +73,15 @@ export class FirebaseError extends Error implements FirebaseErrorInterface { /** * A FirebaseError with a prefix in front of the error code. - * - * @param codePrefix - The prefix to apply to the error code. - * @param code - The error code. - * @param message - The error message. - * @constructor */ export class PrefixedFirebaseError extends FirebaseError { + /** + * @param codePrefix - The prefix to apply to the error code. + * @param code - The error code. + * @param message - The error message. + * @constructor + * @internal + */ constructor(private codePrefix: string, code: string, message: string) { super({ code: `${codePrefix}/${code}`, @@ -105,12 +109,14 @@ export class PrefixedFirebaseError extends FirebaseError { /** * Firebase App error code structure. This extends PrefixedFirebaseError. - * - * @param code - The error code. - * @param message - The error message. - * @constructor */ export class FirebaseAppError extends PrefixedFirebaseError { + /** + * @param code - The error code. + * @param message - The error message. + * @constructor + * @internal + */ constructor(code: string, message: string) { super('app', code, message); @@ -124,11 +130,6 @@ export class FirebaseAppError extends PrefixedFirebaseError { /** * Firebase Auth error code structure. This extends PrefixedFirebaseError. - * - * @param info - The error code info. - * @param [message] The error message. This will override the default - * message if provided. - * @constructor */ export class FirebaseAuthError extends PrefixedFirebaseError { /** @@ -139,6 +140,7 @@ export class FirebaseAuthError extends PrefixedFirebaseError { * if not provided. * @param [rawServerResponse] The error's raw server response. * @returns The corresponding developer-facing error. + * @internal */ public static fromServerError( serverErrorCode: string, @@ -161,7 +163,7 @@ export class FirebaseAuthError extends PrefixedFirebaseError { if (clientCodeKey === 'INTERNAL_ERROR' && typeof rawServerResponse !== 'undefined') { try { - error.message += ` Raw server response: "${ JSON.stringify(rawServerResponse) }"`; + error.message += ` Raw server response: "${JSON.stringify(rawServerResponse)}"`; } catch (e) { // Ignore JSON parsing error. } @@ -170,6 +172,12 @@ export class FirebaseAuthError extends PrefixedFirebaseError { return new FirebaseAuthError(error); } + /** + * @param info - The error code info. + * @param message - The error message. This will override the default message if provided. + * @constructor + * @internal + */ constructor(info: ErrorInfo, message?: string) { // Override default message if custom message provided. super('auth', info.code, message || info.message); @@ -184,13 +192,15 @@ export class FirebaseAuthError extends PrefixedFirebaseError { /** * Firebase Database error code structure. This extends FirebaseError. - * - * @param info - The error code info. - * @param [message] The error message. This will override the default - * message if provided. - * @constructor */ export class FirebaseDatabaseError extends FirebaseError { + /** + * @param info - The error code info. + * @param message - The error message. This will override the default + * message if provided. + * @constructor + * @internal + */ constructor(info: ErrorInfo, message?: string) { // Override default message if custom message provided. super({ code: 'database/' + info.code, message: message || info.message }); @@ -199,13 +209,15 @@ export class FirebaseDatabaseError extends FirebaseError { /** * Firebase Firestore error code structure. This extends FirebaseError. - * - * @param info - The error code info. - * @param [message] The error message. This will override the default - * message if provided. - * @constructor */ export class FirebaseFirestoreError extends FirebaseError { + /** + * @param info - The error code info. + * @param message - The error message. This will override the default + * message if provided. + * @constructor + * @internal + */ constructor(info: ErrorInfo, message?: string) { // Override default message if custom message provided. super({ code: 'firestore/' + info.code, message: message || info.message }); @@ -214,13 +226,16 @@ export class FirebaseFirestoreError extends FirebaseError { /** * Firebase instance ID error code structure. This extends FirebaseError. - * - * @param info - The error code info. - * @param [message] The error message. This will override the default - * message if provided. - * @constructor */ export class FirebaseInstanceIdError extends FirebaseError { + /** + * + * @param info - The error code info. + * @param message - The error message. This will override the default + * message if provided. + * @constructor + * @internal + */ constructor(info: ErrorInfo, message?: string) { // Override default message if custom message provided. super({ code: 'instance-id/' + info.code, message: message || info.message }); @@ -230,13 +245,16 @@ export class FirebaseInstanceIdError extends FirebaseError { /** * Firebase Installations service error code structure. This extends `FirebaseError`. - * - * @param info - The error code info. - * @param message - The error message. This will override the default - * message if provided. - * @constructor */ export class FirebaseInstallationsError extends FirebaseError { + /** + * + * @param info - The error code info. + * @param message - The error message. This will override the default + * message if provided. + * @constructor + * @internal + */ constructor(info: ErrorInfo, message?: string) { // Override default message if custom message provided. super({ code: 'installations/' + info.code, message: message || info.message }); @@ -247,10 +265,6 @@ export class FirebaseInstallationsError extends FirebaseError { /** * Firebase Messaging error code structure. This extends PrefixedFirebaseError. - * - * @param info - The error code info. - * @param [message] The error message. This will override the default message if provided. - * @constructor */ export class FirebaseMessagingError extends PrefixedFirebaseError { /** @@ -261,6 +275,7 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { * if not provided. * @param [rawServerResponse] The error's raw server response. * @returns The corresponding developer-facing error. + * @internal */ public static fromServerError( serverErrorCode: string | null, @@ -277,7 +292,7 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { if (clientCodeKey === 'UNKNOWN_ERROR' && typeof rawServerResponse !== 'undefined') { try { - error.message += ` Raw server response: "${ JSON.stringify(rawServerResponse) }"`; + error.message += ` Raw server response: "${JSON.stringify(rawServerResponse)}"`; } catch (e) { // Ignore JSON parsing error. } @@ -286,6 +301,9 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { return new FirebaseMessagingError(error); } + /** + * @internal + */ public static fromTopicManagementServerError( serverErrorCode: string, message?: string, @@ -298,7 +316,7 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { if (clientCodeKey === 'UNKNOWN_ERROR' && typeof rawServerResponse !== 'undefined') { try { - error.message += ` Raw server response: "${ JSON.stringify(rawServerResponse) }"`; + error.message += ` Raw server response: "${JSON.stringify(rawServerResponse)}"`; } catch (e) { // Ignore JSON parsing error. } @@ -307,6 +325,13 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { return new FirebaseMessagingError(error); } + /** + * + * @param info - The error code info. + * @param message - The error message. This will override the default message if provided. + * @constructor + * @internal + */ constructor(info: ErrorInfo, message?: string) { // Override default message if custom message provided. super('messaging', info.code, message || info.message); @@ -321,12 +346,14 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { /** * Firebase project management error code structure. This extends PrefixedFirebaseError. - * - * @param code - The error code. - * @param message - The error message. - * @constructor */ export class FirebaseProjectManagementError extends PrefixedFirebaseError { + /** + * @param code - The error code. + * @param message - The error message. + * @constructor + * @internal + */ constructor(code: ProjectManagementErrorCode, message: string) { super('project-management', code, message); @@ -442,7 +469,7 @@ export class AuthClientErrorCode { public static INVALID_DYNAMIC_LINK_DOMAIN = { code: 'invalid-dynamic-link-domain', message: 'The provided dynamic link domain is not configured or authorized ' + - 'for the current project.', + 'for the current project.', }; public static INVALID_EMAIL_VERIFIED = { code: 'invalid-email-verified', @@ -467,7 +494,7 @@ export class AuthClientErrorCode { public static INVALID_HASH_ALGORITHM = { code: 'invalid-hash-algorithm', message: 'The hash algorithm must match one of the strings in the list of ' + - 'supported algorithms.', + 'supported algorithms.', }; public static INVALID_HASH_BLOCK_SIZE = { code: 'invalid-hash-block-size', @@ -590,7 +617,7 @@ export class AuthClientErrorCode { public static MISSING_ANDROID_PACKAGE_NAME = { code: 'missing-android-pkg-name', message: 'An Android Package Name must be provided if the Android App is ' + - 'required to be installed.', + 'required to be installed.', }; public static MISSING_CONFIG = { code: 'missing-config', @@ -607,7 +634,7 @@ export class AuthClientErrorCode { public static MISSING_EMAIL = { code: 'missing-email', message: 'The email is required for the specified action. For example, a multi-factor user ' + - 'requires a verified email.', + 'requires a verified email.', }; public static MISSING_IOS_BUNDLE_ID = { code: 'missing-ios-bundle-id', @@ -620,7 +647,7 @@ export class AuthClientErrorCode { public static MISSING_HASH_ALGORITHM = { code: 'missing-hash-algorithm', message: 'Importing users with password hashes requires that the hashing ' + - 'algorithm and its parameters be provided.', + 'algorithm and its parameters be provided.', }; public static MISSING_OAUTH_CLIENT_ID = { code: 'missing-oauth-client-id', @@ -653,8 +680,8 @@ export class AuthClientErrorCode { public static OPERATION_NOT_ALLOWED = { code: 'operation-not-allowed', message: 'The given sign-in provider is disabled for this Firebase project. ' + - 'Enable it in the Firebase console, under the sign-in method tab of the ' + - 'Auth section.', + 'Enable it in the Firebase console, under the sign-in method tab of the ' + + 'Auth section.', }; public static PHONE_NUMBER_ALREADY_EXISTS = { code: 'phone-number-already-exists', @@ -702,7 +729,7 @@ export class AuthClientErrorCode { public static UNAUTHORIZED_DOMAIN = { code: 'unauthorized-continue-uri', message: 'The domain of the continue URL is not whitelisted. Whitelist the domain in the ' + - 'Firebase console.', + 'Firebase console.', }; public static UNSUPPORTED_FIRST_FACTOR = { code: 'unsupported-first-factor', @@ -719,7 +746,7 @@ export class AuthClientErrorCode { public static UNVERIFIED_EMAIL = { code: 'unverified-email', message: 'A verified email is required for the specified action. For example, a multi-factor user ' + - 'requires a verified email.', + 'requires a verified email.', }; public static USER_NOT_FOUND = { code: 'user-not-found', @@ -876,15 +903,15 @@ export class InstanceIdClientErrorCode extends InstallationsClientErrorCode { } export type ProjectManagementErrorCode = - 'already-exists' - | 'authentication-error' - | 'internal-error' - | 'invalid-argument' - | 'invalid-project-id' - | 'invalid-server-response' - | 'not-found' - | 'service-unavailable' - | 'unknown-error'; + 'already-exists' + | 'authentication-error' + | 'internal-error' + | 'invalid-argument' + | 'invalid-project-id' + | 'invalid-server-response' + | 'not-found' + | 'service-unavailable' + | 'unknown-error'; /** @const {ServerToClientCode} Auth server to client enum error codes. */ const AUTH_SERVER_TO_CLIENT_CODE: ServerToClientCode = {