summaryrefslogtreecommitdiff
path: root/compiler/utils/Panic.lhs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-06-02 08:23:45 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-06-02 08:23:45 +0000
commitd529d596a1256bb48bda45ec343631c879c8d56d (patch)
tree10bfc7446cb055b40cb391f22d577e250bf477ae /compiler/utils/Panic.lhs
parent5a73f108480a0b443c74f93fafa2f5495e788643 (diff)
downloadhaskell-d529d596a1256bb48bda45ec343631c879c8d56d.tar.gz
Use UserInterrupt rather than our own Interrupted exception (#4100)
Diffstat (limited to 'compiler/utils/Panic.lhs')
-rw-r--r--compiler/utils/Panic.lhs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs
index ee0677725d..e11b28faef 100644
--- a/compiler/utils/Panic.lhs
+++ b/compiler/utils/Panic.lhs
@@ -63,7 +63,6 @@ ghcError e = Exception.throw e
data GhcException
= PhaseFailed String -- name of phase
ExitCode -- an external phase (eg. cpp) failed
- | Interrupted -- someone pressed ^C
| Signal Int -- some other fatal signal (SIGHUP,SIGTERM)
| UsageError String -- prints the short usage msg after the error
| CmdLineError String -- cmdline prob, but doesn't print usage
@@ -107,8 +106,6 @@ showGhcException (ProgramError str)
= showString str
showGhcException (InstallationError str)
= showString str
-showGhcException (Interrupted)
- = showString "interrupted"
showGhcException (Signal n)
= showString "signal: " . shows n
showGhcException (Panic s)
@@ -151,7 +148,7 @@ assertPanic file line =
\end{code}
\begin{code}
--- | tryMost is like try, but passes through Interrupted and Panic
+-- | tryMost is like try, but passes through UserInterrupt and Panic
-- exceptions. Used when we want soft failures when reading interface
-- files, for example.
@@ -162,7 +159,6 @@ tryMost action = do r <- try action
Left se ->
case fromException se of
-- Some GhcException's we rethrow,
- Just Interrupted -> throwIO se
Just (Signal _) -> throwIO se
Just (Panic _) -> throwIO se
-- others we return
@@ -189,7 +185,7 @@ installSignalHandlers = do
modifyMVar_ interruptTargetThread (return . (main_thread :))
let
- interrupt_exn = (toException Interrupted)
+ interrupt_exn = (toException UserInterrupt)
interrupt = do
withMVar interruptTargetThread $ \targets ->