Skip to content

Commit bde4308

Browse files
fix: Export error classes (#2151)
* Expose error class * Expose more error classes * Expose error codes --------- Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
1 parent 6b558d6 commit bde4308

File tree

8 files changed

+19
-0
lines changed

8 files changed

+19
-0
lines changed

src/app/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ export { initializeApp, getApp, getApps, deleteApp } from './lifecycle';
2929
export { Credential, ServiceAccount, GoogleOAuthAccessToken } from './credential';
3030
export { applicationDefault, cert, refreshToken } from './credential-factory';
3131

32+
export { FirebaseAppError, AppErrorCodes } from '../utils/error';
33+
3234
export const SDK_VERSION = getSdkVersion();

src/auth/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,8 @@ export {
164164
UserMetadata,
165165
UserRecord,
166166
} from './user-record';
167+
168+
export {
169+
FirebaseAuthError,
170+
AuthClientErrorCode,
171+
} from '../utils/error';

src/database/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,5 @@ function getDatabaseInstance(options: { url?: string; app?: App }): Database {
125125
const dbService = firebaseApp.getOrInitService('database', (app) => new DatabaseService(app));
126126
return dbService.getDatabase(options.url);
127127
}
128+
129+
export { FirebaseDatabaseError } from '../utils/error';

src/firestore/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,5 @@ export function initializeFirestore(
220220

221221
return firestoreService.initializeDatabase(databaseId, settings);
222222
}
223+
224+
export { FirebaseFirestoreError } from '../utils/error';

src/installations/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ export function getInstallations(app?: App): Installations {
6161
const firebaseApp: FirebaseApp = app as FirebaseApp;
6262
return firebaseApp.getOrInitService('installations', (app) => new Installations(app));
6363
}
64+
65+
export { FirebaseInstallationsError, InstallationsClientErrorCode } from '../utils/error';

src/instance-id/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@ export function getInstanceId(app?: App): InstanceId {
7070
const firebaseApp: FirebaseApp = app as FirebaseApp;
7171
return firebaseApp.getOrInitService('instanceId', (app) => new InstanceId(app));
7272
}
73+
74+
export { FirebaseInstanceIdError, InstanceIdClientErrorCode } from '../utils/error';

src/messaging/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,5 @@ export function getMessaging(app?: App): Messaging {
100100
const firebaseApp: FirebaseApp = app as FirebaseApp;
101101
return firebaseApp.getOrInitService('messaging', (app) => new Messaging(app));
102102
}
103+
104+
export { FirebaseMessagingError, MessagingClientErrorCode } from '../utils/error';

src/project-management/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ export function getProjectManagement(app?: App): ProjectManagement {
6262
const firebaseApp: FirebaseApp = app as FirebaseApp;
6363
return firebaseApp.getOrInitService('projectManagement', (app) => new ProjectManagement(app));
6464
}
65+
66+
export { FirebaseProjectManagementError, ProjectManagementErrorCode } from '../utils/error';

0 commit comments

Comments
 (0)