feat(errors): Improve error message for incorrect package UUID#4270
Merged
KristofferC merged 2 commits intomasterfrom Jun 27, 2025
Merged
feat(errors): Improve error message for incorrect package UUID#4270KristofferC merged 2 commits intomasterfrom
KristofferC merged 2 commits intomasterfrom
Conversation
When a user attempts to add a package with a correct name but an incorrect UUID, the error message was previously a generic "package not registered". This could leave the user unsure of the root cause. This commit enhances the error handling to detect this specific scenario. If the provided package name exists in the registry but with a different UUID, the error message will now include the correct UUID(s) found for that package name, guiding the user toward the correct command. A new test case is added to ensure the new error message is triggered correctly and displays the expected information. Fixes #4267 This commit was written by an AI assistant.
Keno
reviewed
Jun 26, 2025
| if pkg.name !== nothing | ||
| uuids = Types.registered_uuids(registries, pkg.name) | ||
| if !isempty(uuids) | ||
| msg *= "\n You may have provided the wrong UUID for package $(pkg.name).\n Found the following UUIDs for that name: $(join(uuids, ", "))" |
Member
There was a problem hiding this comment.
Should this tell you what registry it came from?
Member
Author
There was a problem hiding this comment.
Probably, but I got rate limited on Google Gemini CLI so I guess this is as good as it gets 🤣
Member
Author
There was a problem hiding this comment.
You might be in luck, I might have been able to get some $300 free tier thingy.
Member
Author
There was a problem hiding this comment.
julia> Pkg.add(PackageSpec(name="Example", uuid=UUID(UInt128(2))))
Resolving package versions...
ERROR: expected package `Example [00000000]` to be registered
You may have provided the wrong UUID for package Example.
Found the following UUIDs for that name:
- 7876af07-990d-54b4-ab0e-23690620f79a from registry: General
5ec230d to
b3a7ea9
Compare
Keno
approved these changes
Jun 27, 2025
KristofferC
added a commit
that referenced
this pull request
Jul 1, 2025
(cherry picked from commit eefbef6)
KristofferC
added a commit
that referenced
this pull request
Feb 20, 2026
(cherry picked from commit eefbef6)
KristofferC
added a commit
that referenced
this pull request
Feb 23, 2026
(cherry picked from commit eefbef6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a user attempts to add a package with a correct name but an incorrect UUID, the error message was previously a generic "package not registered". This could leave the user unsure of the root cause.
This commit enhances the error handling to detect this specific scenario. If the provided package name exists in the registry but with a different UUID, the error message will now include the correct UUID(s) found for that package name, guiding the user toward the correct command.
A new test case is added to ensure the new error message is triggered correctly and displays the expected information.
Fixes #4267
This commit was written by an AI assistant.