projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8146611
)
Fix the catching of "IOEnv failure" with extensible extensions
author
Ian Lynagh
<igloo@earth.li>
Thu, 31 Jul 2008 19:42:52 +0000
(19:42 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Thu, 31 Jul 2008 19:42:52 +0000
(19:42 +0000)
compiler/typecheck/TcSplice.lhs
patch
|
blob
|
history
diff --git
a/compiler/typecheck/TcSplice.lhs
b/compiler/typecheck/TcSplice.lhs
index
d63b4a0
..
55e0975
100644
(file)
--- a/
compiler/typecheck/TcSplice.lhs
+++ b/
compiler/typecheck/TcSplice.lhs
@@
-73,6
+73,8
@@
import qualified Language.Haskell.TH.Syntax as TH
import GHC.Exts ( unsafeCoerce#, Int#, Int(..) )
#if __GLASGOW_HASKELL__ < 609
import qualified Exception ( userErrors )
import GHC.Exts ( unsafeCoerce#, Int#, Int(..) )
#if __GLASGOW_HASKELL__ < 609
import qualified Exception ( userErrors )
+#else
+import System.IO.Error
#endif
\end{code}
#endif
\end{code}
@@
-603,9
+605,15
@@
runMeta convert expr
-> failM -- Error already in Tc monad
| otherwise -> failWithTc (mk_msg "run" exn) -- Exception
#else
-> failM -- Error already in Tc monad
| otherwise -> failWithTc (mk_msg "run" exn) -- Exception
#else
- Left (SomeException exn) -> do
+ Left (SomeException exn) ->
case cast exn of
case cast exn of
- Just (ErrorCall "IOEnv failure") ->
+ Just (ErrorCall "IOEnv failure") ->
+ failM -- Error already in Tc monad
+ _ ->
+ case cast exn of
+ Just ioe
+ | isUserError ioe &&
+ (ioeGetErrorString ioe == "IOEnv failure") ->
failM -- Error already in Tc monad
_ -> failWithTc (mk_msg "run" exn) -- Exception
#endif
failM -- Error already in Tc monad
_ -> failWithTc (mk_msg "run" exn) -- Exception
#endif