Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Make the error encountered when a package can't be found more user-friendly #369

Closed
wants to merge 1 commit into from

Conversation

bgamari
Copy link
Collaborator

@bgamari bgamari commented Feb 25, 2015

Previously we used getPackageDetails to fetch information about the package providing a module. This started failing regularly when GHC moved to package keys, leading to errors of the form haddock: internal error: expectJust getPackageDetails (see haskell/cabal#2297, #363, #361, #353).

Now we use lookupPackage instead, which provides the means for us to gracefully handle failure. The user should now see the slightly more helpful error,

haddock: Unable to find a package providing module "++moduleName pkgMod++ ", skipping Hoogle."

         Perhaps try specifying the desired package explicitly using the --package-name"
         and --package-version arguments."        

Still not great, but hopefully along with a fixed Cabal release this error should occur rather infrequently.

@bgamari
Copy link
Collaborator Author

bgamari commented Feb 25, 2015

This works for me.

@bgamari bgamari force-pushed the improve-pkg-details-error branch 3 times, most recently from 10640b1 to d6919c1 Compare February 25, 2015 07:34
@bgamari bgamari force-pushed the improve-pkg-details-error branch from d6919c1 to 9879467 Compare February 26, 2015 04:06
@Fuuzetsu
Copy link
Member

Totally forgot about this. Making some minor changes and pushing it in.

@Fuuzetsu Fuuzetsu closed this in fdcd190 Mar 25, 2015
@Fuuzetsu
Copy link
Member

Sorry for the hold up. I made some minor changes to the commit (style only) and pushed in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants