Skip to content

Commit

Permalink
IndexUtils: Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
nh2 committed May 25, 2013
1 parent 62857c6 commit 41ccde8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cabal-install/Distribution/Client/IndexUtils.hs
Expand Up @@ -484,11 +484,12 @@ packageIndexFromCache mkPkg hnd entrs mode = accum mempty [] entrs
readPackageDescription :: ByteString -> IO GenericPackageDescription
readPackageDescription content =
case parsePackageDescription . fromUTF8 . BS.Char8.unpack $ content of
ParseOk _ d -> return d
_ -> interror "failed to parse .cabal file"
ParseOk _ d -> return d
ParseFailed err -> interror $
"failed to parse .cabal file (" ++ show err ++ ")"

interror msg = die $ "internal error when reading package index: " ++ msg
++ "The package index or index cache is probably "
++ "\nThe package index or index cache is probably "
++ "corrupt. Running cabal update might fix it."

------------------------------------------------------------------------
Expand Down

0 comments on commit 41ccde8

Please sign in to comment.