Skip to content

Commit 1ce98e6

Browse files
committed
Updated error type name
1 parent 7005b5a commit 1ce98e6

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

packages/data-connect/src/core/error.ts

+3-17
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,13 @@ export class DataConnectError extends FirebaseError {
4444
readonly name: string = 'DataConnectError';
4545

4646
/** @hideconstructor */
47-
constructor(
48-
/**
49-
* The backend error code associated with this error.
50-
*/
51-
readonly code: DataConnectErrorCode,
52-
/**
53-
* A custom error description.
54-
*/
55-
message: string
56-
) {
47+
constructor(code: Code, message: string) {
5748
super(code, message);
5849

5950
// Ensure the instanceof operator works as expected on subclasses of Error.
6051
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_types
6152
// and https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget
62-
Object.setPrototypeOf(this, new.target.prototype);
53+
Object.setPrototypeOf(this, DataConnectError.prototype);
6354
}
6455

6556
/** @internal */
@@ -78,13 +69,8 @@ export class DataConnectOperationError extends DataConnectError {
7869

7970
/** @hideconstructor */
8071
constructor(message: string, response: DataConnectOperationResponse) {
81-
super('partial-error', message);
72+
super(Code.PARTIAL_ERROR, message);
8273
this.response = response;
83-
84-
// Ensure the instanceof operator works as expected on subclasses of Error.
85-
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_types
86-
// and https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget
87-
Object.setPrototypeOf(this, new.target.prototype);
8874
}
8975
}
9076

0 commit comments

Comments
 (0)