Skip to content

Commit

Permalink
Make "missing packages" error message more descriptive
Browse files Browse the repository at this point in the history
Currently there exist confusion due to Pursuit now showing package
sets that include a package. IOW it always looks as if every package
on Pursuit available on every "package set" from the registry. As
result, when a user receives error message from Spago that says that a
package wasn't found, unless a user already knows this situation, they
unlikely would think it's a problem on the remote side rather than
with syntax or something similar.

But on the `spago` side we can reduce confusion by showing a user
a message hinting that it is possible to enlist available packages
with `spago ls packages`.

Fixes: purescript#1287
  • Loading branch information
Hi-Angel committed Sep 23, 2024
1 parent 6d2f796 commit e7062e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Spago/Command/Fetch.purs
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,9 @@ getTransitiveDepsFromPackageSet packageSet deps = do
when (not (Set.isEmpty errors.cycle)) do
die $ "The following packages have circular dependencies:\n" <> foldMap printPackageError (Set.toUnfoldable errors.cycle :: Array PackageName)
when (not (Set.isEmpty errors.notInPackageSet)) do
die $ "The following packages do not exist in your package set:\n" <> foldMap printNotInPackageSetError errors.notInPackageSet
die $ "The following packages do not exist in your package set:\n"
<> foldMap printNotInPackageSetError errors.notInPackageSet
<> "To list available packages use `spago ls packages`\n"
when (not (Set.isEmpty errors.notInIndex)) do
die $ "The following packages do not exist in the package index:\n" <> foldMap printPackageError errors.notInIndex
pure packages
Expand Down

0 comments on commit e7062e6

Please sign in to comment.