From 875f483cf6fd5a6b67cafa96dccbef6f4f24a87b Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Tue, 10 Aug 2021 14:20:11 -0700 Subject: [PATCH] grpc-js: Map ETIMEDOUT errors to UNAVAILABLE --- packages/grpc-js/src/call-stream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-js/src/call-stream.ts b/packages/grpc-js/src/call-stream.ts index 5e034433..c829f422 100644 --- a/packages/grpc-js/src/call-stream.ts +++ b/packages/grpc-js/src/call-stream.ts @@ -601,7 +601,7 @@ export class Http2CallStream implements Call { * "Internal server error" message. */ details = `Received RST_STREAM with code ${stream.rstCode} (Internal server error)`; } else { - if (this.internalError.code === 'ECONNRESET') { + if (this.internalError.code === 'ECONNRESET' || this.internalError.code === 'ETIMEDOUT') { code = Status.UNAVAILABLE; details = this.internalError.message; } else {