Open twittner opened 11 years ago
AFAICS this behavior is caused by runWebSocketsWith
re-throwing iteratee exceptions. runWebSocketsSnapWith
does not handle this, hence the exception reaches Snap. How about:
catchError (WS.runWebSocketsWith options' (fromSnapRequest rq) ws writeEnd)
(const $ yield () EOF)
or some other safeguard mechanism in https://github.com/jaspervdj/websockets-snap/blob/0f62d70b5ee2d9f3d44fe0683f864df4088bf047/src/Network/WebSockets/Snap.hs#L33 ?
Given this test server:
and this example client.
Starting the server and the client establishes the connection just fine, but when the client receives a
SIGINT
the server logs:an exception escaped to toplevel: ParseError {errorContexts = ["demandInput"], errorMessage = "not enough bytes"}
This happens only before the client has sent any data messages.