Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Network.Anonymous.Tor.Error
Description
Tor error types, inspired by System.IO.Error
- type TorError = TorException
- data TorException = TorError {}
- data TorErrorType
- mkTorError :: TorErrorType -> TorError
- timeoutErrorType :: TorErrorType
- unreachableErrorType :: TorErrorType
- protocolErrorType :: String -> TorErrorType
- permissionDeniedErrorType :: String -> TorErrorType
- torException :: MonadIO m => TorException -> m a
- torError :: MonadIO m => TorError -> m a
Documentation
type TorError = TorException Source
Error type used
data TorException Source
Exception that we use to throw. It is the only type of exception we throw, and the type of error is embedded within the exception.
Constructors
TorError | |
Fields
|
Instances
Eq TorException Source | |
Show TorException Source | |
Exception TorException Source | Derives our Tor exception from the standard exception, which opens it up to being used with all the regular trycatchbracket/etc functions. |
data TorErrorType Source
An abstract type that contains a value for each variant of TorError
Constructors
Timeout | |
Unreachable | |
ProtocolError String | |
PermissionDenied String |
Instances
mkTorError :: TorErrorType -> TorError Source
Generates new TorException
timeoutErrorType :: TorErrorType Source
Tor error when a timeout has occurred
unreachableErrorType :: TorErrorType Source
Tor error when a host was unreachable
protocolErrorType :: String -> TorErrorType Source
Tor error when communication with the SAM bridge fails
permissionDeniedErrorType :: String -> TorErrorType Source
Tor error when communication with the SAM bridge fails
torException :: MonadIO m => TorException -> m a Source
Raise an Tor Exception in the IO monad