diff options
author | Ian Lynagh <igloo@earth.li> | 2008-10-03 16:01:29 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2008-10-03 16:01:29 +0000 |
commit | f4ce543cff19b797d54d435dc7c804acdefca9c8 (patch) | |
tree | 8166995b1debd916977c8d02b17b6ebeeb75adf6 /compiler/utils/Panic.lhs | |
parent | 1f3a7730cd7f831344d2a3b74a0ce700c382e858 (diff) | |
download | haskell-f4ce543cff19b797d54d435dc7c804acdefca9c8.tar.gz |
Use a proper exception for IOEnvFailure, not just a UserError
Diffstat (limited to 'compiler/utils/Panic.lhs')
-rw-r--r-- | compiler/utils/Panic.lhs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs index e6c385c7d2..a49a68d623 100644 --- a/compiler/utils/Panic.lhs +++ b/compiler/utils/Panic.lhs @@ -17,7 +17,7 @@ module Panic panic, panicFastInt, assertPanic, trace, - Exception.Exception(..), showException, try, tryMost, tryUser, throwTo, + Exception.Exception(..), showException, try, tryMost, throwTo, installSignalHandlers, interruptTargetThread ) where @@ -40,7 +40,6 @@ import Control.Concurrent ( MVar, ThreadId, withMVar, newMVar ) import Data.Dynamic import Debug.Trace ( trace ) import System.IO.Unsafe ( unsafePerformIO ) -import System.IO.Error hiding ( try ) import System.Exit import System.Environment \end{code} @@ -171,21 +170,6 @@ tryMost action = do r <- try action -- Anything else is rethrown Nothing -> throwIO se Right v -> return (Right v) - --- | tryUser is like try, but catches only UserErrors. --- These are the ones that are thrown by the TcRn monad --- to signal an error in the program being compiled -tryUser :: IO a -> IO (Either IOException a) -tryUser io = - do ei <- try io - case ei of - Right v -> return (Right v) - Left se -> - case fromException se of - Just ioe - | isUserError ioe -> - return (Left ioe) - _ -> throw se \end{code} Standard signal handlers for catching ^C, which just throw an |