Define a specific `SessionDisconnectedException` to represent STOMP frames completion
joffrey-bion opened this issue · comments
Problem / use case
When sending frames and waiting for receipts, the session might be disconnected in the meantime. This currently throws an IllegalStateException
, which is not very user friendly: we don't want to explicitly catch this exception, but we want to be able to handle such errors when making send()
calls.
Feature (solution)
If the user of the StompSession
decided to disconnect while another coroutine was waiting for a receipt, we could (should?) throw a specific SessionDisconnectedException
instead of IllegalStateException
.
Current alternatives
Catch the IllegalStateException
and analyze the message... which is quite brittle and not very maintainable.