Skip to content

Commit

Permalink
fix: preserve original error code if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Algin Maduro committed Sep 1, 2020
1 parent 4b9da2e commit 5e42be1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/grpc-js/src/server-call.ts
Expand Up @@ -743,7 +743,10 @@ export class Http2ServerCallStream<
// Ignore any remaining messages when errors occur.
this.bufferedMessages.length = 0;

err.code = Status.INTERNAL;
if(!err.code){
err.code = Status.INTERNAL;
}

readable.emit('error', err);
}

Expand Down

0 comments on commit 5e42be1

Please sign in to comment.