Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fix sending completion message for already sent error message
Browse files Browse the repository at this point in the history
  • Loading branch information
segabriel committed Sep 16, 2021
1 parent 4104111 commit 4e26646
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,15 @@ private void onRequest(WebsocketGatewaySession session, ServiceMessage request,
}
return newResponseMessage(sid, response, isErrorResponse);
}))
.doOnError(th -> ReferenceCountUtil.safestRelease(request.data()))
.doOnError(
th ->
session
.send(toErrorResponse(errorMapper, request, th))
.contextWrite(context)
.subscribe())
th -> {
ReferenceCountUtil.safestRelease(request.data());
receivedError.set(true);
session
.send(toErrorResponse(errorMapper, request, th))
.contextWrite(context)
.subscribe();
})
.doOnTerminate(
() -> {
if (!receivedError.get()) {
Expand Down

0 comments on commit 4e26646

Please sign in to comment.