Add hint when authentication fails, rv interactive #1169
Closed
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.
Part of this is to finish up the error output here: #1125
Very small change, because at the moment the warning is displaying on the same line as the connecting message:
so a change to eprintln! will end up with this display which should be sufficient:
So that's when the database indicated doesn't exist.
After that I had a look through the other parameters that can possibly fail inside the credentials directory, they are:
This 'authentication failed' message can take place in a lot of points during the authentication:
https://github.com/edgedb/edgedb/blob/286e015786326f3ce615a405f2cd0eba88642406/edb/server/protocol/frontend.pyx#L561
But looks like they all have something to do with user or password issues so maybe the easiest change at the moment is to stick in a hint that maybe the problem is inside the config file:
Finally, if println! is being used whether interactive or not then there's no need for a few of the functions that pass on the interactive bool so those get deleted.
Edit: now that edgedb/edgedb-rust#284 is merged I've added a note when connecting on how long the CLI will try before giving up. Also a note to the general help output that changing RUST_LOG can help with debugging when something has gone wrong.