mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
grpc-js: don't overwrite existing error codes
This commit causes RPC handlers to default to INTERNAL when an error occurs, but does not overwrite an existing error code.
This commit is contained in:
parent
00b091a1b1
commit
7c2bb2a237
@ -374,7 +374,11 @@ export class Server {
|
||||
}
|
||||
} catch (err) {
|
||||
const call = new Http2ServerCallStream(stream, null!);
|
||||
err.code = Status.INTERNAL;
|
||||
|
||||
if (err.code === undefined) {
|
||||
err.code = Status.INTERNAL;
|
||||
}
|
||||
|
||||
call.sendError(err);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user