Fix error handling for expired html5 registration (#67676)
This commit is contained in:
parent
9f0665bbb4
commit
3953b6abe2
2 changed files with 46 additions and 1 deletions
|
@ -533,7 +533,9 @@ class HTML5NotificationService(BaseNotificationService):
|
|||
if response.status_code == 410:
|
||||
_LOGGER.info("Notification channel has expired")
|
||||
reg = self.registrations.pop(target)
|
||||
if not save_json(self.registrations_json_path, self.registrations):
|
||||
try:
|
||||
save_json(self.registrations_json_path, self.registrations)
|
||||
except HomeAssistantError:
|
||||
self.registrations[target] = reg
|
||||
_LOGGER.error("Error saving registration")
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue