File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import {
2525 FirebaseDataConnectError ,
2626 DataConnectErrorCode ,
2727 DATA_CONNECT_ERROR_CODE_MAPPING ,
28- GRPC_STATUS_CODE_TO_STRING
28+ EMULATOR_GRPC_STATUS_CODE_TO_STRING
2929} from './error' ;
3030import * as utils from '../utils/index' ;
3131import * as validator from '../utils/validator' ;
@@ -421,7 +421,7 @@ export class DataConnectApiClient {
421421
422422 let status = error . status ;
423423 if ( ! status && validator . isNumber ( error . code ) ) {
424- status = GRPC_STATUS_CODE_TO_STRING [ error . code as number ] ;
424+ status = EMULATOR_GRPC_STATUS_CODE_TO_STRING [ error . code as number ] ;
425425 }
426426
427427 let code : DataConnectErrorCode = DATA_CONNECT_ERROR_CODE_MAPPING . UNKNOWN ;
Original file line number Diff line number Diff line change @@ -71,10 +71,12 @@ export class FirebaseDataConnectError extends FirebaseError {
7171}
7272
7373/**
74- * Mappings from gRPC status codes to their string equivalents.
74+ * Mappings from gRPC status codes to their string equivalents. Used to convert
75+ * error codes from the emulator into the codes and statuses matching errors
76+ * from production.
7577 * @internal
7678 */
77- export const GRPC_STATUS_CODE_TO_STRING : Record < number , string > = {
79+ export const EMULATOR_GRPC_STATUS_CODE_TO_STRING : Record < number , string > = {
7880 1 : 'CANCELLED' ,
7981 2 : 'UNKNOWN' ,
8082 3 : 'INVALID_ARGUMENT' ,
You can’t perform that action at this time.
0 commit comments