Make sure sendError sends ErrorResponse when serviceClient#28
Open
Make sure sendError sends ErrorResponse when serviceClient#28
Conversation
`sendError` should throw an error which interrupts the request/response cycle with an `ErrorResponse`. However, the deadlock fix in 813e665 introduced a bug where we no longer ever send an ErrorResponse when `sendError`, just crashing the client-connection thread with an `error` instead. There are two main situations in which we want to run an `Adaptor s r a`: - When `r == ()`, when unlifting `Adaptor` for the threads registered in `registerNewDebugSession` - When `r == Request`, which means we're responding to a `Request`. In the former case, there's no well-defined meaning for the `sendError` thrown error, since we're not responding to any `Request` -- so we just `error` on those uncaught errors. OK. In the latter case, there IS a well-defined meaning for the `sendError` errors: reply with an `ErrorResponse` to the client. Fixes #27
dmjio
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sendErrorshould throw an error which interrupts the request/response cycle with anErrorResponse.However, the deadlock fix in 813e665 introduced a bug where we no longer ever send an ErrorResponse when
sendError, just crashing the client-connection thread with anerrorinstead.There are two main situations in which we want to run an
Adaptor s r a:r == (), when unliftingAdaptorfor the threads registered inregisterNewDebugSessionr == Request, which means we're responding to aRequest.In the former case, there's no well-defined meaning for the
sendErrorthrown error, since we're not responding to anyRequest-- so we justerroron those uncaught errors. OK.In the latter case, there IS a well-defined meaning for the
sendErrorerrors: reply with anErrorResponseto the client.Fixes #27