Skip to content

Commit

Permalink
Only show custom message with snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 16, 2024
1 parent 044b568 commit 5013202
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cabal-install/src/Distribution/Client/ProjectConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -909,15 +909,16 @@ reportParseResult verbosity filetype projectFile (OldParser.ProjectParseFailed (
)
)
rootOrImportee
let doc = nest 2 $ case snippet of
Nothing -> text "-" <+> hsep (text <$> lines msg)
let doc = case snippet of
Nothing -> msg
Just s ->
vcat
[ provenance
, text "-" <+> text "Failed to parse" <+> quotes (text s) <+> (text "with error" <> colon)
, nest 2 $ hsep $ text <$> lines msg
]
dieWithException verbosity $ ReportParseResult filetype sourceFile errLineNo (render doc)
render . nest 2 $
vcat
[ provenance
, text "-" <+> text "Failed to parse" <+> quotes (text s) <+> (text "with error" <> colon)
, nest 2 $ hsep $ text <$> lines msg
]
dieWithException verbosity $ ReportParseResult filetype sourceFile errLineNo doc

---------------------------------------------
-- Finding packages in the project
Expand Down

0 comments on commit 5013202

Please sign in to comment.