Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Network.Anonymous.I2P.Error
Description
I2P error types, inspired by System.IO.Error
- type I2PError = I2PException
- data I2PException = I2PError {}
- data I2PErrorType
- mkI2PError :: I2PErrorType -> I2PError
- noVersionErrorType :: I2PErrorType
- duplicatedSessionIdErrorType :: I2PErrorType
- duplicatedDestinationErrorType :: I2PErrorType
- invalidKeyErrorType :: I2PErrorType
- invalidIdErrorType :: I2PErrorType
- timeoutErrorType :: I2PErrorType
- unreachableErrorType :: I2PErrorType
- messageTooLongErrorType :: I2PErrorType
- protocolErrorType :: I2PErrorType
- i2pException :: MonadIO m => I2PException -> m a
- i2pError :: MonadIO m => I2PError -> m a
Documentation
type I2PError = I2PException #
Error type used
data I2PException #
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
I2PError | |
Fields
|
Instances
Eq I2PException # | |
Show I2PException # | |
Exception I2PException # | Derives our I2P exception from the standard exception, which opens it up to being used with all the regular trycatchbracket/etc functions. |
data I2PErrorType #
An abstract type that contains a value for each variant of I2PError
Constructors
NoVersion | |
DuplicatedSessionId | |
DuplicatedDestination | |
InvalidKey | |
InvalidId | |
Timeout | |
Unreachable | |
ProtocolError | |
MessageTooLong |
Instances
mkI2PError :: I2PErrorType -> I2PError #
Generates new I2PException
noVersionErrorType :: I2PErrorType #
I2P error when no protocol version can be agreed upon
duplicatedSessionIdErrorType :: I2PErrorType #
I2P error when a session id already exists
duplicatedDestinationErrorType :: I2PErrorType #
I2P error when a destination already exists
invalidKeyErrorType :: I2PErrorType #
I2P error when an invalid (destination) key is used
invalidIdErrorType :: I2PErrorType #
I2P error when an invalid (session) id is used
timeoutErrorType :: I2PErrorType #
I2P error when a timeout has occurred
unreachableErrorType :: I2PErrorType #
I2P error when a host was unreachable
messageTooLongErrorType :: I2PErrorType #
I2P error when a datagram message would be too long to transmit
protocolErrorType :: I2PErrorType #
I2P error when communication with the SAM bridge fails
i2pException :: MonadIO m => I2PException -> m a #
Raise an I2P Exception in the IO monad