Portability | portable |
---|---|
Stability | experimental |
Safe Haskell | Safe-Inferred |
Exceptions for the Stompl Client. Note that exceptions thrown in internal worker threads (sender and listener) will be forwarded to the connection owner, that is the thread that actually initialised the connection. Since, in some circumstances, several exceptions may be thrown in response to one error event (e.g. the broker sends an error frame and, immediately afterwards, closes the connection), the connection owner should implement a robust exception handling mechanism.
- data StomplException
- = SocketException String
- | WorkerException String
- | ProtocolException String
- | QueueException String
- | TxException String
- | ConnectException String
- | ConvertException String
- | BrokerException String
- | AppException String
- | OuchException String
- try :: IO a -> IO (Either StomplException a)
- convertError :: String -> IO a
Documentation
data StomplException
SocketException String | Currently not used |
WorkerException String | Thrown when a worker thread terminates unexpectedly; usually, this is a consequence of another error (e.g. the broker closed the socket) and you will probably receive another exception (e.g. a BrokerException) |
ProtocolException String | Thrown when something against the protocol happens, e.g. an unexpected frame is received or a message from a queue that was not subscribed |
QueueException String | Thrown on wrong uses of queues, e.g. use of a queue outside its scope |
TxException String | Thrown on transaction errors, e.g. pending acks |
ConnectException String | Thrown on connection errors, e.g. connection was closed |
ConvertException String | Should be thrown by user-defined converters |
BrokerException String | Thrown when an error frame is received |
AppException String | Thrown by abort |
OuchException String | You hit a bug! This exception is only thrown when something really strange happened |
Eq StomplException | |
Read StomplException | |
Show StomplException | |
Typeable StomplException | |
Exception StomplException |
try :: IO a -> IO (Either StomplException a)
Catches any StomplException
,
including asynchronous exceptions coming from internal threads
convertError :: String -> IO a
Throws ConvertException
to signal a conversion error.