Created
October 13, 2020 19:17
-
-
Save schmidt-sebastian/ebb63b96c048f3c43187edac7523f9c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dev/src/bulk-writer.ts b/dev/src/bulk-writer.ts | |
index e4f4ca7..cf2e930 100644 | |
--- a/dev/src/bulk-writer.ts | |
+++ b/dev/src/bulk-writer.ts | |
@@ -40,9 +40,6 @@ import { | |
validateInteger, | |
validateOptional, | |
} from './validate'; | |
-// TODO: How do I get rid of this? | |
-// eslint-disable-next-line no-undef | |
-import GrpcStatus = FirebaseFirestore.GrpcStatus; | |
/*! | |
* The maximum number of writes that can be in a single batch. | |
@@ -331,8 +328,8 @@ class BulkCommitBatch { | |
} else if (!allowRetry || !this.shouldRetry(result.status.code)) { | |
const error = new BulkWriterError( | |
op.operation, | |
- (result.status.code as unknown) as GrpcStatus, | |
- result.status.message | |
+ result.status.message, | |
+ result.status.code | |
); | |
op.deferred.reject(error); | |
} else { | |
@@ -403,8 +400,8 @@ export class BulkWriterError extends Error { | |
/** @hideconstructor */ | |
constructor( | |
readonly operation: BulkWriterOperation, | |
- readonly code: GrpcStatus, | |
- readonly message: string | |
+ readonly message: string, | |
+ readonly code: Status = Status.UNKNOWN | |
) { | |
super(message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment