zoovisitor-0.2.6.1: A haskell binding to Apache Zookeeper C library(mt) using Haskell Z project.
Safe HaskellSafe-Inferred
LanguageHaskell2010

ZooKeeper.Exception

Synopsis

Documentation

data ZooException Source #

The root exception type of ZooKeeper.

data ZooExInfo Source #

Zookeeper error informations.

Constructors

ZooExInfo 

Fields

Instances

Instances details
Print ZooExInfo Source # 
Instance details

Defined in ZooKeeper.Exception

Methods

toUTF8BuilderP :: Int -> ZooExInfo -> Builder () #

Show ZooExInfo Source # 
Instance details

Defined in ZooKeeper.Exception

System and server-side errors

This is never thrown by the server, it shouldn't be used other than to indicate a range. Specifically error codes greater than this value, but lesser than ZAPIERROR, are system errors.

API Errors

This is never thrown by the server, it shouldn't be used other than to indicate a range. Specifically error codes greater than this value are API errors (while values less than this indicate a ZSYSTEMERROR).

newtype ZNONODE Source #

Constructors

ZNONODE ZooExInfo 

Instances

Instances details
Exception ZNONODE Source # 
Instance details

Defined in ZooKeeper.Exception

Show ZNONODE Source # 
Instance details

Defined in ZooKeeper.Exception

newtype ZNOAUTH Source #

Constructors

ZNOAUTH ZooExInfo 

Instances

Instances details
Exception ZNOAUTH Source # 
Instance details

Defined in ZooKeeper.Exception

Show ZNOAUTH Source # 
Instance details

Defined in ZooKeeper.Exception

newtype ZCLOSING Source #

Constructors

ZCLOSING ZooExInfo 

Instances

Instances details
Exception ZCLOSING Source # 
Instance details

Defined in ZooKeeper.Exception

Show ZCLOSING Source # 
Instance details

Defined in ZooKeeper.Exception

newtype ZNOTHING Source #

Constructors

ZNOTHING ZooExInfo 

Instances

Instances details
Exception ZNOTHING Source # 
Instance details

Defined in ZooKeeper.Exception

Show ZNOTHING Source # 
Instance details

Defined in ZooKeeper.Exception

Other Errors

Error number patterns

pattern CZOK :: CInt Source #

pattern CZAPIERROR :: CInt Source #

pattern CZNONODE :: CInt Source #

pattern CZNOAUTH :: CInt Source #

pattern CZNOTEMPTY :: CInt Source #

pattern CZCLOSING :: CInt Source #

pattern CZNOTHING :: CInt Source #

Helpers

throwIO :: Exception e => e -> IO a #

A variant of throw that can only be used within the IO monad.

Although throwIO has a type that is an instance of the type of throw, the two functions are subtly different:

throw e   `seq` ()  ===> throw e
throwIO e `seq` ()  ===> ()

The first example will cause the exception e to be raised, whereas the second one won't. In fact, throwIO will only cause an exception to be raised when it is used within the IO monad.

The throwIO variant should be used in preference to throw to raise an exception within the IO monad because it guarantees ordering with respect to other operations, whereas throw does not. We say that throwIO throws *precise* exceptions and throw, error, etc. all throw *imprecise* exceptions. For example

throw e + error "boom" ===> error "boom"
throw e + error "boom" ===> throw e

are both valid reductions and the compiler may pick any (loop, even), whereas

throwIO e >> error "boom" ===> throwIO e

will always throw e when executed.

See also the GHC wiki page on precise exceptions for a more technical introduction to how GHC optimises around precise vs. imprecise exceptions.