-
-
Notifications
You must be signed in to change notification settings - Fork 32k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log bare exceptions in the config flow #135584
base: dev
Are you sure you want to change the base?
Conversation
Hey there @disforw, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @gagebenne, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @ManneW, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @tkdrob, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
except Exception as ex: | ||
_LOGGER.exception("Unexpected error") | ||
if type(ex).__name__ == "BadLoginError": | ||
return "invalid_auth" | ||
return "unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am genuinely wondering why we don't do except BadLoginError
. I also could not find a reference in the library. @tkdrob Can you maybe give a hint on this?
except Exception: | ||
LOGGER.exception("Unexpected exception") | ||
errors["base"] = "unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue for this one as it should work since we log the exception
Proposed change
So I found out that BLE001 does not get flagged if the exception is logged using LOGGER.exception, which is a good thing I think. So let's get all the BLE001 noqas out of the codebase!
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: