LDAP-0.6.1: Haskell binding for C LDAP APIContentsIndex
LDAP.Exceptions
MaintainerJohn Goerzen,
Contents
Types
General Catching
Description

Maintainer : jgoerzen@complete.org Stability : provisional Portability: portable

Handling LDAP Exceptions

Written by John Goerzen, jgoerzen@complete.org

Synopsis
data LDAPException = LDAPException {
code :: LDAPReturnCode
description :: String
caller :: String
}
catchLDAP :: IO a -> (LDAPException -> IO a) -> IO a
handleLDAP :: (LDAPException -> IO a) -> IO a -> IO a
failLDAP :: IO a -> IO a
Types
data LDAPException
The basic type of LDAP exceptions. These are raised when an operation does not indicate success.
Constructors
LDAPException
code :: LDAPReturnCodeNumeric error code
description :: StringDescription of error
caller :: StringCalling function
show/hide Instances
General Catching
catchLDAP :: IO a -> (LDAPException -> IO a) -> IO a

Execute the given IO action.

If it raises a LDAPException, then execute the supplied handler and return its return value. Otherwise, process as normal.

handleLDAP :: (LDAPException -> IO a) -> IO a -> IO a
Like catchLDAP, with the order of arguments reversed.
failLDAP :: IO a -> IO a
Catches LDAP errors, and re-raises them as IO errors with fail. Useful if you don't care to catch LDAP errors, but want to see a sane error message if one happens. One would often use this as a high-level wrapper around LDAP calls.
Produced by Haddock version 0.8