Fix error message strings for Todoist configuration flow (#102968)

* Fix error message strings for Todoist configuration flow

* Update error code in test
This commit is contained in:
Allen Porter 2023-10-28 12:02:42 -07:00 committed by GitHub
parent fb5d058885
commit efc9f845db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View file

@ -44,7 +44,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
await api.get_tasks()
except HTTPError as err:
if err.response.status_code == HTTPStatus.UNAUTHORIZED:
errors["base"] = "invalid_access_token"
errors["base"] = "invalid_api_key"
else:
errors["base"] = "cannot_connect"
except Exception: # pylint: disable=broad-except