Skip to content

Commit

Permalink
add dynamic upStreamCodes option
Browse files Browse the repository at this point in the history
  • Loading branch information
hersentino committed Jul 18, 2022
1 parent d76e42d commit e4e20f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/generate-grpc-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function generateGrpcWebImpl(ctx: Context, returnObservable: boolean, hasStreami
${hasStreamingMethods ? 'streamingTransport?: grpc.TransportFactory,' : ``}
debug?: boolean,
metadata?: grpc.Metadata,
upStreamRetryCodes?: number[],
}
`;

Expand Down Expand Up @@ -300,7 +301,7 @@ function createInvokeMethod(ctx: Context) {
metadata: grpc.Metadata | undefined
): ${observableType(ctx)}<any> {
// Status Response Codes (https://developers.google.com/maps-booking/reference/grpc-api/status_codes)
const upStreamCodes = [2, 4, 8, 9, 10, 13, 14, 15];
const upStreamCodes = this.options.upStreamRetryCodes || [2, 4, 8, 9, 10, 13, 14, 15];
const DEFAULT_TIMEOUT_TIME: number = 3_000;
const request = { ..._request, ...methodDesc.requestType };
const maybeCombinedMetadata =
Expand Down

0 comments on commit e4e20f1

Please sign in to comment.