X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSplice.lhs;h=b4cb3166e2bf9e2822d4c209b43d45ed5affbed1;hb=f4ce543cff19b797d54d435dc7c804acdefca9c8;hp=6d33b169593c4eb37a1f49e36144f61317d24f31;hpb=1f3a7730cd7f831344d2a3b74a0ce700c382e858;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs index 6d33b16..b4cb316 100644 --- a/compiler/typecheck/TcSplice.lhs +++ b/compiler/typecheck/TcSplice.lhs @@ -596,15 +596,9 @@ runMeta convert expr Right v -> return v Left se -> case fromException se of - Just (ErrorCall "IOEnv failure") -> + Just IOEnvFailure -> failM -- Error already in Tc monad - _ -> - case fromException se of - Just ioe - | isUserError ioe && - (ioeGetErrorString ioe == "IOEnv failure") -> - failM -- Error already in Tc monad - _ -> failWithTc (mk_msg "run" se) -- Exception + _ -> failWithTc (mk_msg "run" se) -- Exception }}} where mk_msg s exn = vcat [text "Exception when trying to" <+> text s <+> text "compile-time code:", @@ -633,11 +627,10 @@ like that. Here's how it's processed: * The TcM monad is an instance of Quasi (see TcSplice), and it implements (qReport True s) by using addErr to add an error message to the bag of errors. - The 'fail' in TcM raises a UserError, with the uninteresting string - "IOEnv failure" + The 'fail' in TcM raises an IOEnvFailure exception * So, when running a splice, we catch all exceptions; then for - - a UserError "IOEnv failure", we assume the error is already + - an IOEnvFailure exception, we assume the error is already in the error-bag (above) - other errors, we add an error to the bag and then fail