zeromq4-haskell-0.8.0: Bindings to ZeroMQ 4.x

Safe Haskell | None
Language | Haskell98

System.ZMQ4.Internal.Error

Description

We use our own functions for throwing exceptions in order to get the actual error message via `zmq_strerror`. 0MQ defines additional error numbers besides those defined by the operating system, so `zmq_strerror` should be used in preference to `strerror` which is used by the standard throw* functions in `Error`.

Warning: This is an internal module and subject to change without notice.

Synopsis

- data ZMQError = ZMQError {
  - errno :: Int
  - source :: String
  - message :: String
  }
- throwError :: String -> IO a
- throwIf :: (a -> Bool) -> String -> IO a -> IO a
- throwIf_ :: (a -> Bool) -> String -> IO a -> IO ()
- throwIfRetry :: (a -> Bool) -> String -> IO a -> IO a
- throwIfRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
- throwIfMinus1 :: (Eq a, Num a) => String -> IO a -> IO a
- throwIfMinus1_ :: (Eq a, Num a) => String -> IO a -> IO ()
- throwIfNull :: String -> IO (Ptr a) -> IO (Ptr a)
- throwIfMinus1Retry :: (Eq a, Num a) => String -> IO a -> IO a
- throwIfMinus1Retry_ :: (Eq a, Num a) => String -> IO a -> IO ()
- throwIfRetryMayBlock :: (a -> Bool) -> String -> IO a -> IO b -> IO a
- throwIfRetryMayBlock_ :: (a -> Bool) -> String -> IO a -> IO b -> IO ()
- throwIfMinus1RetryMayBlock :: (Eq a, Num a) => String -> IO a -> IO b -> IO a
- throwIfMinus1RetryMayBlock_ :: (Eq a, Num a) => String -> IO a -> IO b -> IO ()
- zmqErrnoMessage :: CInt -> IO String
- zmqErrno :: IO Errno

# Documentation

data ZMQError #

ZMQError encapsulates information about errors, which occur when using the native 0MQ API, such as error number and message.

Constructors

ZMQError |
Fields errno :: Int Error number value. source :: String Source where this error originates from. message :: String Actual error message.

Instances

Eq ZMQError # |
Instance details Defined in System.ZMQ4.Internal.Error Methods (==) :: ZMQError -> ZMQError -> Bool # (/=) :: ZMQError -> ZMQError -> Bool #
Ord ZMQError # |
Instance details Defined in System.ZMQ4.Internal.Error Methods compare :: ZMQError -> ZMQError -> Ordering # (<) :: ZMQError -> ZMQError -> Bool # (<=) :: ZMQError -> ZMQError -> Bool # (>) :: ZMQError -> ZMQError -> Bool # (>=) :: ZMQError -> ZMQError -> Bool # max :: ZMQError -> ZMQError -> ZMQError # min :: ZMQError -> ZMQError -> ZMQError #
Show ZMQError # |
Instance details Defined in System.ZMQ4.Internal.Error Methods showsPrec :: Int -> ZMQError -> ShowS # show :: ZMQError -> String # showList :: [ZMQError] -> ShowS #
Exception ZMQError # |
Instance details Defined in System.ZMQ4.Internal.Error Methods toException :: ZMQError -> SomeException # fromException :: SomeException -> Maybe ZMQError # displayException :: ZMQError -> String #

throwError :: String -> IO a #

throwIf :: (a -> Bool) -> String -> IO a -> IO a #

throwIf_ :: (a -> Bool) -> String -> IO a -> IO () #

throwIfRetry :: (a -> Bool) -> String -> IO a -> IO a #

throwIfRetry_ :: (a -> Bool) -> String -> IO a -> IO () #

throwIfMinus1 :: (Eq a, Num a) => String -> IO a -> IO a #

throwIfMinus1_ :: (Eq a, Num a) => String -> IO a -> IO () #

throwIfNull :: String -> IO (Ptr a) -> IO (Ptr a) #

throwIfMinus1Retry :: (Eq a, Num a) => String -> IO a -> IO a #

throwIfMinus1Retry_ :: (Eq a, Num a) => String -> IO a -> IO () #

throwIfRetryMayBlock :: (a -> Bool) -> String -> IO a -> IO b -> IO a #

throwIfRetryMayBlock_ :: (a -> Bool) -> String -> IO a -> IO b -> IO () #

throwIfMinus1RetryMayBlock :: (Eq a, Num a) => String -> IO a -> IO b -> IO a #

throwIfMinus1RetryMayBlock_ :: (Eq a, Num a) => String -> IO a -> IO b -> IO () #

zmqErrnoMessage :: CInt -> IO String #

zmqErrno :: IO Errno #