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.
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.