Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions etc/firebase-admin.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export interface FirebaseArrayIndexError {
export interface FirebaseError {
cause?: Error;
code: string;
hasCode(code: string): boolean;
httpResponse?: HttpResponse;
message: string;
stack?: string;
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.app-check.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export interface DecodedAppCheckToken {
sub: string;
}

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseAppCheckError extends PrefixedFirebaseError {
export class FirebaseAppCheckError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
5 changes: 2 additions & 3 deletions etc/firebase-admin.app.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ export interface ErrorInfo {
message: string;
}

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseAppError extends PrefixedFirebaseError {
export class FirebaseAppError extends FirebaseError {
constructor(info: ErrorInfo, message?: string);
}

Expand All @@ -80,6 +78,7 @@ export interface FirebaseArrayIndexError {
export interface FirebaseError {
cause?: Error;
code: string;
hasCode(code: string): boolean;
httpResponse?: HttpResponse;
message: string;
stack?: string;
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.auth.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ export interface EmailSignInProviderConfig {
passwordRequired?: boolean;
}

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseAuthError extends PrefixedFirebaseError {
export class FirebaseAuthError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.data-connect.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export interface ExecuteOperationResponse<GraphqlResponse> {
data: GraphqlResponse;
}

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseDataConnectError extends PrefixedFirebaseError {
export class FirebaseDataConnectError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
13 changes: 11 additions & 2 deletions etc/firebase-admin.database.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@ export interface Database extends FirebaseDatabase {
setRules(source: string | Buffer | object): Promise<void>;
}

// @public
export const DatabaseErrorCode: {
readonly INTERNAL_ERROR: "internal-error";
readonly INVALID_ARGUMENT: "invalid-argument";
};

// @public
export type DatabaseErrorCode = typeof DatabaseErrorCode[keyof typeof DatabaseErrorCode];

export { DataSnapshot }

// @public
export const enableLogging: typeof rtdb.enableLogging;

export { EventType }

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseDatabaseError extends PrefixedFirebaseError {
export class FirebaseDatabaseError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.eventarc.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export const EventarcErrorCode: {
// @public
export type EventarcErrorCode = typeof EventarcErrorCode[keyof typeof EventarcErrorCode];

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseEventarcError extends PrefixedFirebaseError {
export class FirebaseEventarcError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.extensions.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const ExtensionsErrorCode: {
// @public
export type ExtensionsErrorCode = typeof ExtensionsErrorCode[keyof typeof ExtensionsErrorCode];

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseExtensionsError extends PrefixedFirebaseError {
export class FirebaseExtensionsError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
15 changes: 13 additions & 2 deletions etc/firebase-admin.firestore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export { FieldValue }

export { Filter }

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseFirestoreError extends PrefixedFirebaseError {
export class FirebaseFirestoreError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand All @@ -112,6 +112,17 @@ export { Firestore }

export { FirestoreDataConverter }

// @public
export const FirestoreErrorCode: {
readonly FAILED_PRECONDITION: "failed-precondition";
readonly INVALID_ARGUMENT: "invalid-argument";
readonly INVALID_CREDENTIAL: "invalid-credential";
readonly MISSING_DEPENDENCIES: "missing-dependencies";
};

// @public
export type FirestoreErrorCode = typeof FirestoreErrorCode[keyof typeof FirestoreErrorCode];

// @public
export interface FirestoreSettings {
preferRest?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.functions.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export interface DelayDelivery {
// @public
export type DeliverySchedule = DelayDelivery | AbsoluteDelivery;

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseFunctionsError extends PrefixedFirebaseError {
export class FirebaseFunctionsError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.installations.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { Agent } from 'http';

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseInstallationsError extends PrefixedFirebaseError {
export class FirebaseInstallationsError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.instance-id.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { Agent } from 'http';

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseInstanceIdError extends PrefixedFirebaseError {
export class FirebaseInstanceIdError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
6 changes: 3 additions & 3 deletions etc/firebase-admin.machine-learning.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { Agent } from 'http';

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export class FirebaseMachineLearningError extends PrefixedFirebaseError {
// @public
export class FirebaseMachineLearningError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
5 changes: 2 additions & 3 deletions etc/firebase-admin.messaging.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ export interface FcmOptions {
analyticsLabel?: string;
}

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseMessagingError extends PrefixedFirebaseError {
export class FirebaseMessagingError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down Expand Up @@ -289,7 +289,6 @@ export interface NotificationMessagePayload {

// @public
export interface SendResponse {
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
error?: FirebaseError;
messageId?: string;
success: boolean;
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.phone-number-verification.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { Agent } from 'http';

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebasePhoneNumberVerificationError extends PrefixedFirebaseError {
export class FirebasePhoneNumberVerificationError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.project-management.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ 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
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseProjectManagementError extends PrefixedFirebaseError {
export class FirebaseProjectManagementError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
4 changes: 2 additions & 2 deletions etc/firebase-admin.remote-config.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export interface FetchResponseData {
status: number;
}

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseRemoteConfigError extends PrefixedFirebaseError {
export class FirebaseRemoteConfigError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
6 changes: 3 additions & 3 deletions etc/firebase-admin.security-rules.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { Agent } from 'http';

// Warning: (ae-forgotten-export) The symbol "PrefixedFirebaseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export class FirebaseSecurityRulesError extends PrefixedFirebaseError {
// @public
export class FirebaseSecurityRulesError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}
Expand Down
20 changes: 20 additions & 0 deletions etc/firebase-admin.storage.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import { Agent } from 'http';
import { Bucket } from '@google-cloud/storage';
import { File as File_2 } from '@google-cloud/storage';

// Warning: (ae-forgotten-export) The symbol "FirebaseError" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseStorageError extends FirebaseError {
// Warning: (ae-forgotten-export) The symbol "ErrorInfo" needs to be exported by the entry point index.d.ts
constructor(info: ErrorInfo, message?: string);
}

// @public
export function getDownloadURL(file: File_2): Promise<string>;

Expand All @@ -23,4 +31,16 @@ class Storage_2 {
}
export { Storage_2 as Storage }

// @public
export const StorageErrorCode: {
readonly INVALID_ARGUMENT: "invalid-argument";
readonly INVALID_EMULATOR_HOST: "invalid-emulator-host";
readonly MISSING_DEPENDENCIES: "missing-dependencies";
readonly INVALID_CREDENTIAL: "invalid-credential";
readonly NO_DOWNLOAD_TOKEN: "no-download-token";
};

// @public
export type StorageErrorCode = typeof StorageErrorCode[keyof typeof StorageErrorCode];

```
6 changes: 3 additions & 3 deletions src/app-check/app-check-api-client-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { FirebaseApp } from '../app/firebase-app';
import {
HttpRequestConfig, HttpClient, RequestResponseError, AuthorizedHttpClient, RequestResponse
} from '../utils/api-request';
import { PrefixedFirebaseError, toHttpResponse } from '../utils/error';
import { FirebaseError, toHttpResponse } from '../utils/error';
import { FirebaseAppCheckError, AppCheckErrorCode, APP_CHECK_ERROR_CODE_MAPPING } from './error';
import * as utils from '../utils/index';
import * as validator from '../utils/validator';
Expand Down Expand Up @@ -166,8 +166,8 @@ export class AppCheckApiClient {
});
}

private toFirebaseError(err: RequestResponseError): PrefixedFirebaseError {
if (err instanceof PrefixedFirebaseError) {
private toFirebaseError(err: RequestResponseError): FirebaseError {
if (err instanceof FirebaseError) {
return err;
}

Expand Down
16 changes: 12 additions & 4 deletions src/app-check/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { PrefixedFirebaseError, ErrorInfo } from '../utils/error';
import { FirebaseError, ErrorInfo } from '../utils/error';

/** @const {Record<string, AppCheckErrorCode>} App Check server to client error code mapping. */
export const APP_CHECK_ERROR_CODE_MAPPING: Record<string, AppCheckErrorCode> = {
Expand Down Expand Up @@ -49,14 +49,22 @@ export const AppCheckErrorCode = {
export type AppCheckErrorCode = typeof AppCheckErrorCode[keyof typeof AppCheckErrorCode];

/**
* Firebase App Check error type. This extends PrefixedFirebaseError.
* Firebase App Check error code structure. This extends `FirebaseError`.
*/
export class FirebaseAppCheckError extends PrefixedFirebaseError {
export class FirebaseAppCheckError extends FirebaseError {
/** @internal */
protected readonly codePrefix = 'app-check';

/**
* @param info - The error code info.
* @param message - The error message. If provided, this will override the default message.
*/
constructor(info: ErrorInfo, message?: string) {
super('app-check', info.code, message || info.message, info.httpResponse, info.cause);
super({
code: `app-check/${info.code}`,
message: message || info.message,
httpResponse: info.httpResponse,
cause: info.cause,
});
}
}
Loading
Loading