S allius/issue472 (#473)

* catch socket.gaierror exception

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
Stefan Allius
2025-07-15 21:09:29 +02:00
committed by GitHub
parent 0b05f6cd9a
commit 8c3f3ba827
2 changed files with 5 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
- catch socket.gaierror exception and log this with info level
- Update dependency coverage to v7.9.2
- add-on: bump base-image to version 18.0.3
- add-on: remove armhf and armv7 support

View File

@@ -4,6 +4,7 @@ import logging
import traceback
import json
import gc
import socket
from aiomqtt import MqttCodeError
from asyncio import StreamReader, StreamWriter
from ipaddress import ip_address
@@ -138,7 +139,9 @@ class InverterBase(InverterIfc, Proxy):
f'Connected to {addr}')
asyncio.create_task(self.remote.ifc.client_loop(addr))
except (ConnectionRefusedError, TimeoutError) as error:
except (ConnectionRefusedError,
TimeoutError,
socket.gaierror) as error:
logging.info(f'{error}')
except Exception:
Infos.inc_counter('SW_Exception')