Improve credential errors for github-likes #235
Merged
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.
Previously, when a credential was auto-discovered or entered -- but then access failed -- identical errors meesages were produced:
without any advice on what to do.
With this change, the error message is different, depending on whether a credential was automatically determined from a query, or whether it was entered manually right before the access attempt. Now it would say:
Auto-selected existing credential:
Entered credential:
In both cases the underlying reason for the unsuccessful attempt (generally a 401 response code) continues to be reported.
Now a user can be better aware how credential selection can be performed, and that there is a credential management command.
The idea of an interactive enter-try-fail-reenter loop to guide a user has been rejected, because of the implied complexity from possible mitigation strategies. Importantly, the fact that an existing credential does not work for a particular operation is insufficient for concluding that a credential is completely invalid (hence could be replaced). It may simply be insufficient for the target operation, but remains useful or needed for others.