Skip to content

Commit

Permalink
Merge pull request #12673 from Hellomik2002/catch-stream-error-grpc
Browse files Browse the repository at this point in the history
FIX catch stream errors in grpc
  • Loading branch information
kamilmysliwiec authored Nov 17, 2023
2 parents e00fb64 + 8dfba64 commit a3f3b97
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/microservices/server/server-grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@ export class ServerGrpc extends Server implements CustomTransportStrategy {
const handler = methodHandler(req.asObservable(), call.metadata, call);
const res = this.transformToObservable(await handler);
if (isResponseStream) {
await this.writeObservableToGrpc(res, call);
try {
await this.writeObservableToGrpc(res, call);
}
catch (err) {
call.emit('error', err);
return;
}
} else {
const response = await lastValueFrom(
res.pipe(
Expand Down

0 comments on commit a3f3b97

Please sign in to comment.