From 106215a5b23ff68e0e976dc599c5109832579fab Mon Sep 17 00:00:00 2001 From: Harman Gakhal Date: Fri, 23 Aug 2019 12:19:42 -0700 Subject: [PATCH] Return specific grpc status code on http error --- javascript/net/grpc/web/grpcwebclientreadablestream.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javascript/net/grpc/web/grpcwebclientreadablestream.js b/javascript/net/grpc/web/grpcwebclientreadablestream.js index 79a0dc58..e598323e 100644 --- a/javascript/net/grpc/web/grpcwebclientreadablestream.js +++ b/javascript/net/grpc/web/grpcwebclientreadablestream.js @@ -203,6 +203,9 @@ const GrpcWebClientReadableStream = function(genericTransportInterface) { case ErrorCode.TIMEOUT: grpcStatusCode = StatusCode.DEADLINE_EXCEEDED; break; + case ErrorCode.HTTP_ERROR: + grpcStatusCode = StatusCode.fromHttpStatus(self.xhr_.getStatus()); + break; default: grpcStatusCode = StatusCode.UNAVAILABLE; }