From bcee0e21da37d59bf1ecd02e50d7f690b47fc310 Mon Sep 17 00:00:00 2001 From: Magnus Persson Date: Fri, 5 Aug 2022 11:16:58 +0200 Subject: [PATCH] Corrected error code from mqtt push --- src/pushtarget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pushtarget.cpp b/src/pushtarget.cpp index f6a32fd..97ced61 100644 --- a/src/pushtarget.cpp +++ b/src/pushtarget.cpp @@ -488,8 +488,10 @@ void PushTarget::sendMqtt(TemplatingEngine& engine, bool isSecure, Log.notice(F("PUSH: MQTT publish successful on %s" CR), topic.c_str()); _lastCode = 0; } else { + _lastSuccess = false; + _lastCode = mqtt.lastError(); writeErrorLog("PUSH: MQTT push on %s failed error=%d", topic.c_str(), - mqtt.lastError()); + _lastCode); } }