Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit c3ca30e

Browse files
committed
Improve error message of unparsable hie.yaml
1 parent 5741038 commit c3ca30e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Haskell/Ide/Engine/Server.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ run scheduler _origDir plugins captureFp = flip E.catches handlers $ do
158158

159159
-- Check for mismatching GHC versions
160160
let dummyCradleFile = fromMaybe currentDir lspRootDir </> "File.hs"
161-
logm $ "Dummy Cradle file result: " ++ dummyCradleFile
161+
debugm $ "Dummy Cradle file result: " ++ dummyCradleFile
162162
cradleRes <- liftIO $ E.try (findLocalCradle dummyCradleFile)
163163
let sf = Core.sendFunc lf
164164

@@ -180,9 +180,9 @@ run scheduler _origDir plugins captureFp = flip E.catches handlers $ do
180180
sf $ NotShowMessage $ fmServerShowMessageNotification J.MtWarning cabalMsg
181181
sf $ NotLogMessage $ fmServerLogMessageNotification J.MtWarning cabalMsg
182182

183-
Left (_ :: Yaml.ParseException) -> do
184-
logm "Failed to parse it"
185-
sf $ NotShowMessage $ fmServerShowMessageNotification J.MtError "Couldn't parse hie.yaml"
183+
Left (e :: Yaml.ParseException) -> do
184+
logm $ "Failed to parse `hie.yaml`: " ++ show e
185+
sf $ NotShowMessage $ fmServerShowMessageNotification J.MtError ("Couldn't parse hie.yaml: \n" <> T.pack (show e))
186186

187187
let mcradle = case cradleRes of
188188
Left _ -> Nothing

0 commit comments

Comments
 (0)