Skip to content

Commit 1faea9c

Browse files
committed
Improve error message for --probe-tools
When `getRuntimeGhcVersion'` throws an error, display that error
1 parent d32d3fa commit 1faea9c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

exe/Wrapper.hs

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module Main where
99

1010
import Control.Monad.Extra
1111
import Data.Default
12-
import Data.Either.Extra (eitherToMaybe)
1312
import Data.Foldable
1413
import Data.List
1514
import Data.List.Extra (trimEnd)
@@ -76,8 +75,11 @@ main = do
7675
putStrLn $ showProgramVersionOfInterest programsOfInterest
7776
putStrLn "Tool versions in your project"
7877
cradle <- findProjectCradle' recorder False
79-
ghcVersion <- runExceptT $ getRuntimeGhcVersion' cradle
80-
putStrLn $ showProgramVersion "ghc" $ mkVersion =<< eitherToMaybe ghcVersion
78+
runExceptT (getRuntimeGhcVersion' cradle) >>= \case
79+
Left err ->
80+
T.hPutStrLn stderr (prettyError err NoShorten)
81+
Right ghcVersion ->
82+
putStrLn $ showProgramVersion "ghc" $ mkVersion ghcVersion
8183

8284
VersionMode PrintVersion ->
8385
putStrLn hlsVer

0 commit comments

Comments
 (0)