From c2095a6257f87148fc0a4f5159563e3f32e8fc3d Mon Sep 17 00:00:00 2001 From: Dominik Meyer Date: Sun, 18 Feb 2024 21:23:44 +0100 Subject: [PATCH] FIX: improved error handling for subscriptions --- FHEM/98_NTFY_CLIENT.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FHEM/98_NTFY_CLIENT.pm b/FHEM/98_NTFY_CLIENT.pm index cb91dfa..5d257ba 100644 --- a/FHEM/98_NTFY_CLIENT.pm +++ b/FHEM/98_NTFY_CLIENT.pm @@ -238,9 +238,15 @@ sub NTFY_WS_CB my $name = $hash->{NAME}; + readingsBeginUpdate($hash); + readingsBulkUpdate($hash, "state", "error"); + readingsBulkUpdate($hash, "error", $error); + readingsEndUpdate($hash,1); + NTFY_LOG(LOG_ERROR, "error while connecting to websocket: $error ") if $error; NTFY_LOG(LOG_DEBUG, "websocket callback called"); return $error; + } sub NTFY_Read