Use more narrow exception catching in nest (#63225)

This commit is contained in:
Allen Porter 2022-01-02 09:54:56 -08:00 committed by GitHub
parent b9daa22891
commit 15baea4ba3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 24 deletions

View file

@ -35,7 +35,7 @@ import async_timeout
from google_nest_sdm.exceptions import (
AuthException,
ConfigurationException,
GoogleNestException,
SubscriberException,
)
import voluptuous as vol
@ -285,7 +285,7 @@ class NestFlowHandler(
except ConfigurationException as err:
_LOGGER.error("Configuration error creating subscription: %s", err)
errors[CONF_CLOUD_PROJECT_ID] = "bad_project_id"
except GoogleNestException as err:
except SubscriberException as err:
_LOGGER.error("Error creating subscription: %s", err)
errors[CONF_CLOUD_PROJECT_ID] = "subscriber_error"