Skip to content

Commit 1f6818d

Browse files
committed
Make "missing packages" error message more descriptive
Currently there exists 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: #1287
1 parent 6d2f796 commit 1f6818d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Spago/Command/Fetch.purs

+3-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,9 @@ getTransitiveDepsFromPackageSet packageSet deps = do
725725
when (not (Set.isEmpty errors.cycle)) do
726726
die $ "The following packages have circular dependencies:\n" <> foldMap printPackageError (Set.toUnfoldable errors.cycle :: Array PackageName)
727727
when (not (Set.isEmpty errors.notInPackageSet)) do
728-
die $ "The following packages do not exist in your package set:\n" <> foldMap printNotInPackageSetError errors.notInPackageSet
728+
die $ "The following packages do not exist in your package set:\n"
729+
<> foldMap printNotInPackageSetError errors.notInPackageSet
730+
<> "To list available packages use `spago ls packages`\n"
729731
when (not (Set.isEmpty errors.notInIndex)) do
730732
die $ "The following packages do not exist in the package index:\n" <> foldMap printPackageError errors.notInIndex
731733
pure packages

test-fixtures/missing-dependencies.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Reading Spago workspace configuration...
88
- bar-bar-bar
99
- effcet (did you mean: effect)
1010
- foo-foo-foo
11+
To list available packages use `spago ls packages`

0 commit comments

Comments
 (0)