Open richardlewisjones opened 1 year ago
Hey @alejandrojnm Do you think issue is still a valid one? If yes, I can raise a PR to fix this. I also think that internal db error messages should not be exposed to clients, let me know what do you think?
Hi thanks for asking, I'm not sure we can ask to @uzaxirr about this
Sure thing! @uzaxirr Let us know your thoughts on this?
hey @dipu989 on the latest version of CLI, if you use a wrong API key you will get.
the API will return the below response
{
"code": "database_account_not_found",
"reason": "Failed to find the account within the internal database"
}
Please let me know your approach and raise a PR
@uzaxirr How about error like - WrongAPIKeyError: API Key is invalid.
I am not sure if WrongAPIKeyError will be a valid error type in the code base but probably we can add this type of Error in the enum? What do you think? This actually gives the user, a proper reason for failure without exposing any internal implementation detail.
Forbidden
or Permission Denied
doesn't make a lot of sense here, as this ain't a typical API response 🤔
Let me know if you think otherwise.
Thanks.
@dipu989 please raise a PR
When an invalid API key is used, users see this error message:
The error message does not mention the API key, and a reference to 'the internal database' is not helpful. A better message would be something like
API key is invalid. See https://www.civo.com/api#authentication