diff options
author | pepe <unknown> | 2008-09-26 20:48:36 +0000 |
---|---|---|
committer | pepe <unknown> | 2008-09-26 20:48:36 +0000 |
commit | ec197dfef33654dd16b5832905dad2e52f79f7ab (patch) | |
tree | 02208340ce46e6c5ac09f783387843a015e7a17b /compiler/utils/Panic.lhs | |
parent | cd85694dcc3fd0cccbba84421185b41ae7fd762a (diff) | |
download | haskell-ec197dfef33654dd16b5832905dad2e52f79f7ab.tar.gz |
Don't capture error calls in tryUser
A previous patch slightly changed the semantics of tryUser.
This patch restores the original behaviour
(as expected in :print)
Diffstat (limited to 'compiler/utils/Panic.lhs')
-rw-r--r-- | compiler/utils/Panic.lhs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs index 6f7a4a8018..0e049b0cfb 100644 --- a/compiler/utils/Panic.lhs +++ b/compiler/utils/Panic.lhs @@ -219,22 +219,16 @@ tryUser action = tryJust tc_errors action tc_errors e@(Exception.IOException ioe) | isUserError ioe = Just e tc_errors _other = Nothing #else -tryUser :: IO a -> IO (Either ErrorCall a) +tryUser :: IO a -> IO (Either IOException a) tryUser io = do ei <- try io case ei of Right v -> return (Right v) Left se@(SomeException ex) -> - case cast ex of - -- Look for good old fashioned ErrorCall's - Just errorCall -> return (Left errorCall) - Nothing -> - case cast ex of - -- And also for user errors in IO errors. - -- Sigh. + case cast ex of Just ioe | isUserError ioe -> - return (Left (ErrorCall (ioeGetErrorString ioe))) + return (Left ioe) _ -> throw se #endif \end{code} |