X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FException.hs;h=76b4d63dbdc98bb4ef9051cd477f621fd8188e29;hb=9fa9bc17072a58c0bae2cce4764d38677e96ac29;hp=96205c65defb907844a6fc6654d2088d8ed5024c;hpb=b5882429e82e23f729ce9790b14a39c16bd4d336;p=ghc-base.git diff --git a/Control/Exception.hs b/Control/Exception.hs index 96205c6..76b4d63 100644 --- a/Control/Exception.hs +++ b/Control/Exception.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- +-- | -- Module : Control.Exception -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/core/LICENSE) @@ -8,7 +8,7 @@ -- Stability : experimental -- Portability : non-portable -- --- $Id: Exception.hs,v 1.3 2001/10/18 11:10:19 rrt Exp $ +-- $Id: Exception.hs,v 1.7 2002/04/24 16:31:37 simonmar Exp $ -- -- The External API for exceptions. The functions provided in this -- module allow catching of exceptions in the IO monad. @@ -47,7 +47,6 @@ module Control.Exception ( -- Throwing exceptions throw, -- :: Exception -> a - -- for now throwTo, -- :: ThreadId -> Exception -> a -- Dynamic exceptions @@ -77,7 +76,8 @@ module Control.Exception ( #ifdef __GLASGOW_HASKELL__ import Prelude hiding (catch) -import GHC.Prim ( assert ) +import System.IO.Error +import GHC.Base ( assert ) import GHC.Exception hiding (try, catch, bracket, bracket_) import GHC.Conc ( throwTo, ThreadId ) import GHC.IOBase ( IO(..) ) @@ -200,7 +200,7 @@ dynExceptions _ = Nothing asyncExceptions (AsyncException e) = Just e asyncExceptions _ = Nothing -userErrors (UserError e) = Just e +userErrors e | isUserError e = Just (ioeGetErrorString e) userErrors _ = Nothing -----------------------------------------------------------------------------