From e81d1ddf64ba86b99509b0a708dfb22e11899f76 Mon Sep 17 00:00:00 2001 From: Dennis Kugelmann Date: Mon, 17 Apr 2023 08:46:39 +0000 Subject: [PATCH 1/3] Expose error class --- src/auth/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/auth/index.ts b/src/auth/index.ts index 8af9c7e246..315cfaac0f 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -160,3 +160,7 @@ export { UserMetadata, UserRecord, } from './user-record'; + +export { + FirebaseAuthError, +} from '../utils/error.ts'; From 19ed59e9ec0a445b49270b97e0b197cbf339efed Mon Sep 17 00:00:00 2001 From: Dennis Kugelmann Date: Mon, 17 Apr 2023 09:02:49 +0000 Subject: [PATCH 2/3] Expose more error classes --- src/app/index.ts | 2 ++ src/database/index.ts | 2 ++ src/firestore/index.ts | 2 ++ src/installations/index.ts | 2 ++ src/instance-id/index.ts | 2 ++ src/messaging/index.ts | 2 ++ src/project-management/index.ts | 2 ++ 7 files changed, 14 insertions(+) diff --git a/src/app/index.ts b/src/app/index.ts index 02a8509653..debed5a47f 100644 --- a/src/app/index.ts +++ b/src/app/index.ts @@ -29,4 +29,6 @@ export { initializeApp, getApp, getApps, deleteApp } from './lifecycle'; export { Credential, ServiceAccount, GoogleOAuthAccessToken } from './credential'; export { applicationDefault, cert, refreshToken } from './credential-factory'; +export { FirebaseAppError } from '../utils/error'; + export const SDK_VERSION = getSdkVersion(); diff --git a/src/database/index.ts b/src/database/index.ts index 9a5fbfdf5e..003984b62f 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -125,3 +125,5 @@ function getDatabaseInstance(options: { url?: string; app?: App }): Database { const dbService = firebaseApp.getOrInitService('database', (app) => new DatabaseService(app)); return dbService.getDatabase(options.url); } + +export { FirebaseDatabaseError } from '../utils/error'; diff --git a/src/firestore/index.ts b/src/firestore/index.ts index 661d9fe9bc..e684d967bd 100644 --- a/src/firestore/index.ts +++ b/src/firestore/index.ts @@ -186,3 +186,5 @@ export function initializeFirestore( return firestoreService.initializeDatabase(databaseId, settings); } + +export { FirebaseFirestoreError } from '../utils/error'; diff --git a/src/installations/index.ts b/src/installations/index.ts index c790c2c8ce..53bf1f2625 100644 --- a/src/installations/index.ts +++ b/src/installations/index.ts @@ -61,3 +61,5 @@ export function getInstallations(app?: App): Installations { const firebaseApp: FirebaseApp = app as FirebaseApp; return firebaseApp.getOrInitService('installations', (app) => new Installations(app)); } + +export { FirebaseInstallationsError } from '../utils/error'; diff --git a/src/instance-id/index.ts b/src/instance-id/index.ts index 6d014aeebb..28c52b542d 100644 --- a/src/instance-id/index.ts +++ b/src/instance-id/index.ts @@ -70,3 +70,5 @@ export function getInstanceId(app?: App): InstanceId { const firebaseApp: FirebaseApp = app as FirebaseApp; return firebaseApp.getOrInitService('instanceId', (app) => new InstanceId(app)); } + +export { FirebaseInstanceIdError } from '../utils/error'; diff --git a/src/messaging/index.ts b/src/messaging/index.ts index 2371004e33..9e1b0cabc2 100644 --- a/src/messaging/index.ts +++ b/src/messaging/index.ts @@ -100,3 +100,5 @@ export function getMessaging(app?: App): Messaging { const firebaseApp: FirebaseApp = app as FirebaseApp; return firebaseApp.getOrInitService('messaging', (app) => new Messaging(app)); } + +export { FirebaseMessagingError } from '../utils/error'; diff --git a/src/project-management/index.ts b/src/project-management/index.ts index 3a1f8490e1..81e9597a5e 100644 --- a/src/project-management/index.ts +++ b/src/project-management/index.ts @@ -62,3 +62,5 @@ export function getProjectManagement(app?: App): ProjectManagement { const firebaseApp: FirebaseApp = app as FirebaseApp; return firebaseApp.getOrInitService('projectManagement', (app) => new ProjectManagement(app)); } + +export { FirebaseProjectManagementError } from '../utils/error'; From e88c9f51de2bd4a1c7d9e2cc0cf45499572c0184 Mon Sep 17 00:00:00 2001 From: Dennis Kugelmann Date: Mon, 17 Apr 2023 09:06:34 +0000 Subject: [PATCH 3/3] Expose error codes --- src/app/index.ts | 2 +- src/auth/index.ts | 3 ++- src/installations/index.ts | 2 +- src/instance-id/index.ts | 2 +- src/messaging/index.ts | 2 +- src/project-management/index.ts | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/index.ts b/src/app/index.ts index debed5a47f..5308e414e2 100644 --- a/src/app/index.ts +++ b/src/app/index.ts @@ -29,6 +29,6 @@ export { initializeApp, getApp, getApps, deleteApp } from './lifecycle'; export { Credential, ServiceAccount, GoogleOAuthAccessToken } from './credential'; export { applicationDefault, cert, refreshToken } from './credential-factory'; -export { FirebaseAppError } from '../utils/error'; +export { FirebaseAppError, AppErrorCodes } from '../utils/error'; export const SDK_VERSION = getSdkVersion(); diff --git a/src/auth/index.ts b/src/auth/index.ts index 315cfaac0f..64572385b7 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -163,4 +163,5 @@ export { export { FirebaseAuthError, -} from '../utils/error.ts'; + AuthClientErrorCode, +} from '../utils/error'; diff --git a/src/installations/index.ts b/src/installations/index.ts index 53bf1f2625..1d6a39dc35 100644 --- a/src/installations/index.ts +++ b/src/installations/index.ts @@ -62,4 +62,4 @@ export function getInstallations(app?: App): Installations { return firebaseApp.getOrInitService('installations', (app) => new Installations(app)); } -export { FirebaseInstallationsError } from '../utils/error'; +export { FirebaseInstallationsError, InstallationsClientErrorCode } from '../utils/error'; diff --git a/src/instance-id/index.ts b/src/instance-id/index.ts index 28c52b542d..1a9c06d3bc 100644 --- a/src/instance-id/index.ts +++ b/src/instance-id/index.ts @@ -71,4 +71,4 @@ export function getInstanceId(app?: App): InstanceId { return firebaseApp.getOrInitService('instanceId', (app) => new InstanceId(app)); } -export { FirebaseInstanceIdError } from '../utils/error'; +export { FirebaseInstanceIdError, InstanceIdClientErrorCode } from '../utils/error'; diff --git a/src/messaging/index.ts b/src/messaging/index.ts index 9e1b0cabc2..298a2d5f10 100644 --- a/src/messaging/index.ts +++ b/src/messaging/index.ts @@ -101,4 +101,4 @@ export function getMessaging(app?: App): Messaging { return firebaseApp.getOrInitService('messaging', (app) => new Messaging(app)); } -export { FirebaseMessagingError } from '../utils/error'; +export { FirebaseMessagingError, MessagingClientErrorCode } from '../utils/error'; diff --git a/src/project-management/index.ts b/src/project-management/index.ts index 81e9597a5e..cc23066681 100644 --- a/src/project-management/index.ts +++ b/src/project-management/index.ts @@ -63,4 +63,4 @@ export function getProjectManagement(app?: App): ProjectManagement { return firebaseApp.getOrInitService('projectManagement', (app) => new ProjectManagement(app)); } -export { FirebaseProjectManagementError } from '../utils/error'; +export { FirebaseProjectManagementError, ProjectManagementErrorCode } from '../utils/error';