Skip to content

Slightly misleading error message when adding a repository with wrong url #6943

@yannl35133

Description

@yannl35133

When a repository name has already been assigned (globally, but the user isn't aware) and added to one switch, then tried to be added with another url in another switch, the error message can be a bit confusing:
[ERROR] Repository repo is already set up and points to https://example.org/repo. To change that, use 'opam repository set-url repo https://example.org/repo2'.

I think the information that the mapping is global and that the set up may have happened in another switch should be made more explicit.
Maybe something like this?

[ERROR] Repository repo has already been globally set up and points to https://example.org/repo.
To add the repository to the current switch with this address, use 'opam repository add repo';
to change the address, use 'opam repository set-url repo https://example.org/repo2'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions