Corrected error code from mqtt push

This commit is contained in:
Magnus Persson 2022-08-05 11:16:58 +02:00
parent 9fc5ab147d
commit bcee0e21da

View File

@ -488,8 +488,10 @@ void PushTarget::sendMqtt(TemplatingEngine& engine, bool isSecure,
Log.notice(F("PUSH: MQTT publish successful on %s" CR), topic.c_str()); Log.notice(F("PUSH: MQTT publish successful on %s" CR), topic.c_str());
_lastCode = 0; _lastCode = 0;
} else { } else {
_lastSuccess = false;
_lastCode = mqtt.lastError();
writeErrorLog("PUSH: MQTT push on %s failed error=%d", topic.c_str(), writeErrorLog("PUSH: MQTT push on %s failed error=%d", topic.c_str(),
mqtt.lastError()); _lastCode);
} }
} }