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

Commit 7843214

Browse files
committed
better error 2
1 parent b3dc1a0 commit 7843214

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hie-bios/src/HIE/Bios/Cradle.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ cabalAction work_dir mc _fp = do
122122
++ [component_name | Just component_name <- [mc]]
123123
(ex, args, stde) <-
124124
withCurrentDirectory work_dir (readProcessWithExitCode "cabal" cab_args [])
125-
let [dir, ghc_args] = lines args
126-
final_args = map (fixImportDirs dir) (words ghc_args)
127-
traceM dir
128-
return (ex, stde, final_args)
125+
case lines args of
126+
[dir, ghc_args] -> do
127+
let final_args = map (fixImportDirs dir) (words ghc_args)
128+
traceM dir
129+
return (ex, stde, final_args)
130+
_ -> error (show (ex, args, stde))
129131

130132
fixImportDirs :: FilePath -> String -> String
131133
fixImportDirs base_dir arg =

0 commit comments

Comments
 (0)