From 65152943e6fe80dc5314e897dbf910137b01c47b Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 11 Jun 2012 17:43:46 +0100 Subject: Pass DynFlags to prettyPrintGhcErrors We don't use it yet --- compiler/main/ErrUtils.lhs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'compiler') diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs index 7de0232e96..a89293fb61 100644 --- a/compiler/main/ErrUtils.lhs +++ b/compiler/main/ErrUtils.lhs @@ -334,15 +334,16 @@ debugTraceMsg :: DynFlags -> Int -> MsgDoc -> IO () debugTraceMsg dflags val msg = ifVerbose dflags val (log_action dflags SevInfo noSrcSpan defaultDumpStyle msg) -prettyPrintGhcErrors :: ExceptionMonad m => m a -> m a -prettyPrintGhcErrors = ghandle $ \e -> case e of - PprPanic str doc -> - pprDebugAndThen panic str doc - PprSorry str doc -> - pprDebugAndThen sorry str doc - PprProgramError str doc -> - pprDebugAndThen pgmError str doc - _ -> - throw e +prettyPrintGhcErrors :: ExceptionMonad m => DynFlags -> m a -> m a +prettyPrintGhcErrors _ + = ghandle $ \e -> case e of + PprPanic str doc -> + pprDebugAndThen panic str doc + PprSorry str doc -> + pprDebugAndThen sorry str doc + PprProgramError str doc -> + pprDebugAndThen pgmError str doc + _ -> + throw e \end{code} -- cgit v1.2.1