Commit dc813469 authored by ross's avatar ross
Browse files

[project @ 2002-12-12 13:21:46 by ross]

Use ioError instead of throw for IOErrors, in anticipation of
a change from IOError = Exception to IOError = IOException.
parent 7d599828
{-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-}
-----------------------------------------------------------------------------
-- $Id: InteractiveUI.hs,v 1.138 2002/12/05 12:36:54 simonmar Exp $
-- $Id: InteractiveUI.hs,v 1.139 2002/12/12 13:21:46 ross Exp $
--
-- GHC Interactive User Interface
--
......@@ -295,7 +295,7 @@ fileLoop hdl prompt = do
l <- io (IO.try (hGetLine hdl))
case l of
Left e | isEOFError e -> return ()
| otherwise -> throw e
| otherwise -> io (ioError e)
Right l ->
case remove_spaces l of
"" -> fileLoop hdl prompt
......
......@@ -86,7 +86,7 @@ import Data.IORef
import Data.Char ( ord, chr )
import Data.Array.Base ( unsafeRead, unsafeWrite )
import Control.Monad ( when )
import Control.Exception ( throw, throwDyn )
import Control.Exception ( throwDyn )
import System.IO as IO
import System.IO.Unsafe ( unsafeInterleaveIO )
import System.IO.Error ( mkIOError, eofErrorType )
......@@ -297,7 +297,7 @@ getWord8 (BinMem _ ix_r sz_r arr_r) = do
ix <- readFastMutInt ix_r
sz <- readFastMutInt sz_r
when (ix >= sz) $
throw (mkIOError eofErrorType "Data.Binary.getWord8" Nothing Nothing)
ioError (mkIOError eofErrorType "Data.Binary.getWord8" Nothing Nothing)
arr <- readIORef arr_r
w <- unsafeRead arr ix
writeFastMutInt ix_r (ix+1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment