Skip to content

Commit

Permalink
fix: handle stream callback is undefined (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored May 3, 2022
1 parent bca9a91 commit 269f805
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/fallbackServiceStub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ export function generateServiceStub(
})
.catch((err: Error) => {
if (!cancelRequested || err.name !== 'AbortError') {
callback(err);
if (rpc.responseStream) {
if (callback) {
callback(err);
}
streamArrayParser.emit('error', err);
} else {
callback(err);
}
}
});
}
Expand Down

0 comments on commit 269f805

Please sign in to comment.