LDAP-0.6.11: Haskell binding for C LDAP API
CopyrightCopyright (C) 2005-2009 John Goerzen
LicenseBSD
MaintainerJohn Goerzen,
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

LDAP.Exceptions

Description

Handling LDAP Exceptions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Types

General Catching

catchLDAP :: IO a -> (LDAPException -> IO a) -> IO a Source #

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

Like catchLDAP, with the order of arguments reversed.

failLDAP :: IO a -> IO a Source #

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.

throwLDAP :: LDAPException -> IO a Source #

A utility function to throw an LDAPException. The mechanics of throwing such a thing differ between GHC 6.8.x, Hugs, and GHC 6.10. This function takes care of the special cases to make it simpler.

With GHC 6.10, it is a type-restricted alias for throw. On all other systems, it is a type-restricted alias for throwDyn.