Skip to content

Commit

Permalink
Merge pull request #42 from VeeeneX/main
Browse files Browse the repository at this point in the history
Fix: Retry integration when node is back online
  • Loading branch information
dougiteixeira authored Mar 12, 2023
2 parents 5518cff + df9cfb8 commit 46abc06
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/proxmoxve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from proxmoxer import ProxmoxAPI, AuthenticationError
from proxmoxer.core import ResourceException
from requests.exceptions import ConnectTimeout, SSLError
from requests.exceptions import ConnectTimeout, SSLError, RetryError, ConnectionError
import voluptuous as vol

from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
Expand Down Expand Up @@ -201,6 +201,14 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
raise ConfigEntryNotReady(
f"Connection to host {host} timed out during setup"
) from error
except RetryError as error:
raise ConfigEntryNotReady(
f"Connection is unreachable to host {host}"
) from error
except ConnectionError as error:
raise ConfigEntryNotReady(
f"Connection is unreachable to host {host}"
) from error
except ResourceException as error:
raise ConfigEntryNotReady from error

Expand Down

0 comments on commit 46abc06

Please sign in to comment.