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 Source #

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

Instances details

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

throwError :: String -> IO a Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

zmqErrnoMessage :: CInt -> IO String Source #

zmqErrno :: IO Errno Source #