Skip to content

Commit

Permalink
Improve error message for --probe-tools
Browse files Browse the repository at this point in the history
When `getRuntimeGhcVersion'` throws an error, display that error
  • Loading branch information
sgillespie committed Aug 20, 2024
1 parent d32d3fa commit 1faea9c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions exe/Wrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Main where

import Control.Monad.Extra
import Data.Default
import Data.Either.Extra (eitherToMaybe)
import Data.Foldable
import Data.List
import Data.List.Extra (trimEnd)
Expand Down Expand Up @@ -76,8 +75,11 @@ main = do
putStrLn $ showProgramVersionOfInterest programsOfInterest
putStrLn "Tool versions in your project"
cradle <- findProjectCradle' recorder False
ghcVersion <- runExceptT $ getRuntimeGhcVersion' cradle
putStrLn $ showProgramVersion "ghc" $ mkVersion =<< eitherToMaybe ghcVersion
runExceptT (getRuntimeGhcVersion' cradle) >>= \case
Left err ->
T.hPutStrLn stderr (prettyError err NoShorten)
Right ghcVersion ->
putStrLn $ showProgramVersion "ghc" $ mkVersion ghcVersion

VersionMode PrintVersion ->
putStrLn hlsVer
Expand Down

0 comments on commit 1faea9c

Please sign in to comment.