Improve error message printing
- Omit unnecessary show-invocation - Use showOutputable for the error span (location) before/after: "RealSrcSpan SrcSpanPoint \"stdin\" 2 1: parse error (possibly incorrect indentation or mismatched brackets)" stdin:2:1: parse error (possibly incorrect indentation or mismatched brackets)pull/273/head
parent
af227a797d
commit
342cf16c56
|
@ -325,7 +325,7 @@ coreIO putErrorLnIO config suppressOutput inputPathM outputPathM =
|
|||
case parseResult of
|
||||
Left left -> do
|
||||
putErrorLn "parse error:"
|
||||
putErrorLn $ show left
|
||||
putErrorLn left
|
||||
ExceptT.throwE 60
|
||||
Right (anns, parsedSource, hasCPP) -> do
|
||||
(inlineConf, perItemConf) <-
|
||||
|
|
|
@ -123,7 +123,7 @@ parseModuleFromString args fp dynCheck str =
|
|||
dynCheckRes <- ExceptT.ExceptT $ liftIO $ dynCheck dflags1
|
||||
let res = ExactPrint.parseModuleFromStringInternal dflags1 fp str
|
||||
case res of
|
||||
Left (span, err) -> ExceptT.throwE $ show span ++ ": " ++ err
|
||||
Left (span, err) -> ExceptT.throwE $ showOutputable span ++ ": " ++ err
|
||||
Right (a , m ) -> pure (a, m, dynCheckRes)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue