Before this PR, entering an incorrect username or password in the config flow would cause the form to display “Unexpected error”, while the hass logs would print “Unexpected exception” and a stack trace:
2024-02-09 18:25:24.786 ERROR (MainThread) [custom_components.volkswagen_we_connect_id.config_flow] Unexpected exception
Traceback (most recent call last):
File "/home/vscode/.homeassistant/custom_components/volkswagen_we_connect_id/config_flow.py", line 62, in async_step_user
info = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vscode/.homeassistant/custom_components/volkswagen_we_connect_id/config_flow.py", line 37, in validate_input
await hass.async_add_executor_job(we_connect.login)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/weconnect/weconnect.py", line 187, in login
self.__session.login()
File "/home/vscode/.local/lib/python3.12/site-packages/weconnect/auth/we_connect_session.py", line 76, in login
response = self.doWebAuth(authorizationUrl)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vscode/.local/lib/python3.12/site-packages/weconnect/auth/we_connect_session.py", line 198, in doWebAuth
raise AuthentificationError(f'Error during login, account {self.sessionuser.username} does not exist')
weconnect.errors.AuthentificationError: Error during login, account foo@example.com does not exist
The last line above might also be:
weconnect.errors.AuthentificationError: Error during login, email invalid
After this PR, nothing is printed in the hass logs (at least not with my default log level), and the user interface displays a seemingly hass-standard “Invalid authentication” message:
The reason why I was messing with that is that I was testing my code changes in another PR, #245.
Before this PR, entering an incorrect username or password in the config flow would cause the form to display “Unexpected error”, while the hass logs would print “Unexpected exception” and a stack trace:
The last line above might also be:
After this PR, nothing is printed in the hass logs (at least not with my default log level), and the user interface displays a seemingly hass-standard “Invalid authentication” message:
The reason why I was messing with that is that I was testing my code changes in another PR, #245.