Copyright | Copyright (C) 2005-2009 John Goerzen |
---|---|
License | BSD |
Maintainer | John Goerzen, |
Safe Haskell | Safe |
Language | Haskell98 |
LDAP.Exceptions
Contents
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
- throwLDAP :: LDAPException -> IO a
Types
data LDAPException #
The basic type of LDAP exceptions. These are raised when an operation does not indicate success.
Constructors
LDAPException | |
Fields
|
Instances
Eq LDAPException # | |
Defined in LDAP.Exceptions | |
Ord LDAPException # | |
Defined in LDAP.Exceptions Methods compare :: LDAPException -> LDAPException -> Ordering (<) :: LDAPException -> LDAPException -> Bool (<=) :: LDAPException -> LDAPException -> Bool (>) :: LDAPException -> LDAPException -> Bool (>=) :: LDAPException -> LDAPException -> Bool max :: LDAPException -> LDAPException -> LDAPException min :: LDAPException -> LDAPException -> LDAPException | |
Show LDAPException # | |
Defined in LDAP.Exceptions Methods showsPrec :: Int -> LDAPException -> ShowS show :: LDAPException -> String showList :: [LDAPException] -> ShowS | |
Exception LDAPException # | |
Defined in LDAP.Exceptions Methods toException :: LDAPException -> SomeException fromException :: SomeException -> Maybe LDAPException displayException :: LDAPException -> String |
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.
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 #
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.