Handle processing errors when writing to Zabbix (#148449)

This commit is contained in:
Oliver Heesakkers 2025-07-09 08:01:54 +02:00 committed by GitHub
parent 6b5b35fece
commit afcd991262
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,7 @@ from urllib.parse import urljoin
import voluptuous as vol import voluptuous as vol
from zabbix_utils import ItemValue, Sender, ZabbixAPI from zabbix_utils import ItemValue, Sender, ZabbixAPI
from zabbix_utils.exceptions import APIRequestError from zabbix_utils.exceptions import APIRequestError, ProcessingError
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST, CONF_HOST,
@ -282,6 +282,8 @@ class ZabbixThread(threading.Thread):
if not self.write_errors: if not self.write_errors:
_LOGGER.error("Write error: %s", err) _LOGGER.error("Write error: %s", err)
self.write_errors += len(metrics) self.write_errors += len(metrics)
except ProcessingError as prerr:
_LOGGER.error("Error writing to Zabbix: %s", prerr)
def run(self) -> None: def run(self) -> None:
"""Process incoming events.""" """Process incoming events."""