1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

Fix CO2signal error handling (#61311)

This commit is contained in:
Paulus Schoutsen 2021-12-08 22:50:30 -08:00 committed by GitHub
parent 8f238d6b53
commit 2e65923205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -134,9 +134,6 @@ def get_data(hass: HomeAssistant, config: dict) -> CO2SignalResponse:
_LOGGER.exception("Unexpected exception")
raise UnknownError from err
except Exception as err:
_LOGGER.exception("Unexpected exception")
raise UnknownError from err
else:
if "error" in data:

View File

@ -10,7 +10,7 @@ from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CON
from homeassistant.data_entry_flow import FlowResult
import homeassistant.helpers.config_validation as cv
from . import APIRatelimitExceeded, CO2Error, InvalidAuth, UnknownError, get_data
from . import APIRatelimitExceeded, CO2Error, InvalidAuth, get_data
from .const import CONF_COUNTRY_CODE, DOMAIN
from .util import get_extra_name
@ -172,7 +172,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
errors["base"] = "invalid_auth"
except APIRatelimitExceeded:
errors["base"] = "api_ratelimit"
except UnknownError:
except Exception: # pylint: disable=broad-except
errors["base"] = "unknown"
else:
return self.async_create_entry(