diff options
Diffstat (limited to 'libraries/base/GHC/Event')
-rw-r--r-- | libraries/base/GHC/Event/Array.hs | 6 | ||||
-rw-r--r-- | libraries/base/GHC/Event/Control.hs | 4 | ||||
-rw-r--r-- | libraries/base/GHC/Event/EPoll.hsc | 2 | ||||
-rw-r--r-- | libraries/base/GHC/Event/KQueue.hsc | 4 | ||||
-rw-r--r-- | libraries/base/GHC/Event/Manager.hs | 6 | ||||
-rw-r--r-- | libraries/base/GHC/Event/PSQ.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/Event/Poll.hsc | 6 | ||||
-rw-r--r-- | libraries/base/GHC/Event/TimerManager.hs | 4 |
8 files changed, 17 insertions, 17 deletions
diff --git a/libraries/base/GHC/Event/Array.hs b/libraries/base/GHC/Event/Array.hs index 61cc773007..903f7c0c23 100644 --- a/libraries/base/GHC/Event/Array.hs +++ b/libraries/base/GHC/Event/Array.hs @@ -45,7 +45,7 @@ import GHC.Show (show) -- This fugly hack is brought by GHC's apparent reluctance to deal -- with MagicHash and UnboxedTuples when inferring types. Eek! #define CHECK_BOUNDS(_func_,_len_,_k_) \ -if (_k_) < 0 || (_k_) >= (_len_) then error ("GHC.Event.Array." ++ (_func_) ++ ": bounds error, index " ++ show (_k_) ++ ", capacity " ++ show (_len_)) else +if (_k_) < 0 || (_k_) >= (_len_) then errorWithoutStackTrace ("GHC.Event.Array." ++ (_func_) ++ ": bounds error, index " ++ show (_k_) ++ ", capacity " ++ show (_len_)) else #else #define CHECK_BOUNDS(_func_,_len_,_k_) #endif @@ -247,7 +247,7 @@ copy' d dstart s sstart maxCount = copyHack d s undefined copyHack :: Storable b => AC b -> AC b -> b -> IO (AC b) copyHack dac@(AC _ oldLen _) (AC src slen _) dummy = do when (maxCount < 0 || dstart < 0 || dstart > oldLen || sstart < 0 || - sstart > slen) $ error "copy: bad offsets or lengths" + sstart > slen) $ errorWithoutStackTrace "copy: bad offsets or lengths" let size = sizeOf dummy count = min maxCount (slen - sstart) if count == 0 @@ -267,7 +267,7 @@ removeAt a i = removeHack a undefined removeHack :: Storable b => Array b -> b -> IO () removeHack (Array ary) dummy = do AC fp oldLen cap <- readIORef ary - when (i < 0 || i >= oldLen) $ error "removeAt: invalid index" + when (i < 0 || i >= oldLen) $ errorWithoutStackTrace "removeAt: invalid index" let size = sizeOf dummy newLen = oldLen - 1 when (newLen > 0 && i < newLen) . diff --git a/libraries/base/GHC/Event/Control.hs b/libraries/base/GHC/Event/Control.hs index 5dcc66e6dc..0b0f5587a7 100644 --- a/libraries/base/GHC/Event/Control.hs +++ b/libraries/base/GHC/Event/Control.hs @@ -159,7 +159,7 @@ readControlMessage ctrl fd r <- c_read (fromIntegral fd) (castPtr p_siginfo) sizeof_siginfo_t when (r /= fromIntegral sizeof_siginfo_t) $ - error "failed to read siginfo_t" + errorWithoutStackTrace "failed to read siginfo_t" let !s' = fromIntegral s return $ CMsgSignal fp s' @@ -195,7 +195,7 @@ sendMessage fd msg = alloca $ \p -> do case msg of CMsgWakeup -> poke p io_MANAGER_WAKEUP CMsgDie -> poke p io_MANAGER_DIE - CMsgSignal _fp _s -> error "Signals can only be sent from within the RTS" + CMsgSignal _fp _s -> errorWithoutStackTrace "Signals can only be sent from within the RTS" fromIntegral `fmap` c_write (fromIntegral fd) p 1 #if defined(HAVE_EVENTFD) diff --git a/libraries/base/GHC/Event/EPoll.hsc b/libraries/base/GHC/Event/EPoll.hsc index 2cffb00931..26b6861004 100644 --- a/libraries/base/GHC/Event/EPoll.hsc +++ b/libraries/base/GHC/Event/EPoll.hsc @@ -29,7 +29,7 @@ import qualified GHC.Event.Internal as E import GHC.Base new :: IO E.Backend -new = error "EPoll back end not implemented for this platform" +new = errorWithoutStackTrace "EPoll back end not implemented for this platform" available :: Bool available = False diff --git a/libraries/base/GHC/Event/KQueue.hsc b/libraries/base/GHC/Event/KQueue.hsc index 2b8d443415..1068ec0136 100644 --- a/libraries/base/GHC/Event/KQueue.hsc +++ b/libraries/base/GHC/Event/KQueue.hsc @@ -19,7 +19,7 @@ import qualified GHC.Event.Internal as E import GHC.Base new :: IO E.Backend -new = error "KQueue back end not implemented for this platform" +new = errorWithoutStackTrace "KQueue back end not implemented for this platform" available :: Bool available = False @@ -274,7 +274,7 @@ toEvent :: Filter -> E.Event toEvent (Filter f) | f == (#const EVFILT_READ) = E.evtRead | f == (#const EVFILT_WRITE) = E.evtWrite - | otherwise = error $ "toEvent: unknown filter " ++ show f + | otherwise = errorWithoutStackTrace $ "toEvent: unknown filter " ++ show f foreign import ccall unsafe "kqueue" c_kqueue :: IO CInt diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs index 0ca02c45c4..013850b5d2 100644 --- a/libraries/base/GHC/Event/Manager.hs +++ b/libraries/base/GHC/Event/Manager.hs @@ -172,7 +172,7 @@ newDefaultBackend = EPoll.new #elif defined(HAVE_POLL) newDefaultBackend = Poll.new #else -newDefaultBackend = error "no back end for this platform" +newDefaultBackend = errorWithoutStackTrace "no back end for this platform" #endif -- | Create a new event manager. @@ -212,7 +212,7 @@ failOnInvalidFile loc fd m = do when (not ok) $ let msg = "Failed while attempting to modify registration of file " ++ show fd ++ " at location " ++ loc - in error msg + in errorWithoutStackTrace msg registerControlFd :: EventManager -> Fd -> Event -> IO () registerControlFd mgr fd evs = @@ -267,7 +267,7 @@ loop mgr@EventManager{..} = do -- in Thread.restartPollLoop. See #8235 Finished -> return () _ -> do cleanup mgr - error $ "GHC.Event.Manager.loop: state is already " ++ + errorWithoutStackTrace $ "GHC.Event.Manager.loop: state is already " ++ show state where go = do state <- step mgr diff --git a/libraries/base/GHC/Event/PSQ.hs b/libraries/base/GHC/Event/PSQ.hs index 3421b5a984..e61c31b1b4 100644 --- a/libraries/base/GHC/Event/PSQ.hs +++ b/libraries/base/GHC/Event/PSQ.hs @@ -458,7 +458,7 @@ tourView (Winner e (LLoser _ e' tl m tr) m') = -- Utility functions moduleError :: String -> String -> a -moduleError fun msg = error ("GHC.Event.PSQ." ++ fun ++ ':' : ' ' : msg) +moduleError fun msg = errorWithoutStackTrace ("GHC.Event.PSQ." ++ fun ++ ':' : ' ' : msg) {-# NOINLINE moduleError #-} ------------------------------------------------------------------------ diff --git a/libraries/base/GHC/Event/Poll.hsc b/libraries/base/GHC/Event/Poll.hsc index 6cbe14398b..b128572e71 100644 --- a/libraries/base/GHC/Event/Poll.hsc +++ b/libraries/base/GHC/Event/Poll.hsc @@ -17,7 +17,7 @@ import GHC.Base import qualified GHC.Event.Internal as E new :: IO E.Backend -new = error "Poll back end not implemented for this platform" +new = errorWithoutStackTrace "Poll back end not implemented for this platform" available :: Bool available = False @@ -62,7 +62,7 @@ modifyFd p fd oevt nevt = return True modifyFdOnce :: Poll -> Fd -> E.Event -> IO Bool -modifyFdOnce = error "modifyFdOnce not supported in Poll backend" +modifyFdOnce = errorWithoutStackTrace "modifyFdOnce not supported in Poll backend" reworkFd :: Poll -> PollFd -> IO () reworkFd p (PollFd fd npevt opevt) = do @@ -72,7 +72,7 @@ reworkFd p (PollFd fd npevt opevt) = do else do found <- A.findIndex ((== fd) . pfdFd) ary case found of - Nothing -> error "reworkFd: event not found" + Nothing -> errorWithoutStackTrace "reworkFd: event not found" Just (i,_) | npevt /= 0 -> A.unsafeWrite ary i $ PollFd fd npevt 0 | otherwise -> A.removeAt ary i diff --git a/libraries/base/GHC/Event/TimerManager.hs b/libraries/base/GHC/Event/TimerManager.hs index c1ab64c7a9..93b1766f5e 100644 --- a/libraries/base/GHC/Event/TimerManager.hs +++ b/libraries/base/GHC/Event/TimerManager.hs @@ -108,7 +108,7 @@ newDefaultBackend :: IO Backend #if defined(HAVE_POLL) newDefaultBackend = Poll.new #else -newDefaultBackend = error "no back end for this platform" +newDefaultBackend = errorWithoutStackTrace "no back end for this platform" #endif -- | Create a new event manager. @@ -168,7 +168,7 @@ loop mgr = do Created -> go `finally` cleanup mgr Dying -> cleanup mgr _ -> do cleanup mgr - error $ "GHC.Event.Manager.loop: state is already " ++ + errorWithoutStackTrace $ "GHC.Event.Manager.loop: state is already " ++ show state where go = do running <- step mgr |