Change an "undefined" into a more informative error; trac #2782
[ghc-base.git] / System / Exit.hs
index ef19936..e211ca5 100644 (file)
@@ -23,13 +23,12 @@ module System.Exit
 import Prelude
 
 #ifdef __GLASGOW_HASKELL__
-import GHC.Exception
 import GHC.IOBase
 #endif
 
 #ifdef __HUGS__
-import Hugs.Prelude
-import Hugs.Exception
+import Hugs.Prelude (ExitCode(..))
+import Control.Exception.Base
 #endif
 
 #ifdef __NHC__
@@ -61,9 +60,9 @@ import System
 
 #ifndef __NHC__
 exitWith :: ExitCode -> IO a
-exitWith ExitSuccess = throwIO (ExitException ExitSuccess)
+exitWith ExitSuccess = throwIO ExitSuccess
 exitWith code@(ExitFailure n)
-  | n /= 0 = throwIO (ExitException code)
+  | n /= 0 = throwIO code
 #ifdef __GLASGOW_HASKELL__
   | otherwise = ioError (IOError Nothing InvalidArgument "exitWith" "ExitFailure 0" Nothing)
 #endif