Created
August 14, 2023 07:07
-
-
Save sanderkob/693cf1c7664d2048fde183263edff221 to your computer and use it in GitHub Desktop.
AsyncTelegram2.cpp modified for checking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (err) | |
{ | |
log_error("deserializeJson() failed\n"); | |
log_debug("%s", err.c_str()); | |
log_error(); | |
log_error(m_rxbuffer); | |
// Skip this message id due to the impossibility to parse correctly | |
m_lastUpdateId = m_rxbuffer.substring(m_rxbuffer.indexOf(F("\"update_id\":")) + strlen("\"update_id\":")).toInt() + 1; | |
// int64_t chat_id = m_rxbuffer.substring( m_rxbuffer.indexOf("{\"id\":") + strlen("{\"id\":")).toInt(); | |
// Inform the user about parsing error (blocking) | |
String msgtext = "[ERROR] - No memory: inrease buffer size with \"setJsonBufferSize(buf_size)\" method"; | |
sendTo(message.chatId, msgtext); | |
msgtext = "[ERROR] - deserializeJson() failed\n"; | |
msgtext += err.c_str(); | |
sendTo(message.chatId, msgtext); | |
msgtext = "[ERROR] - rxbuffer\n"; | |
msgtext += m_rxbuffer; | |
sendTo(message.chatId, msgtext); | |
msgtext = "[ERROR] - JsonBufferSize\n"; | |
msgtext += m_JsonBufferSize; | |
sendTo(message.chatId, msgtext); | |
msgtext = "[ERROR] - rxbuffer len msg\n"; | |
msgtext += m_rxbuffer.length(); | |
sendTo(message.chatId, msgtext); | |
msgtext = "[ERROR] - content len msg\n"; | |
msgtext += m_contentLength; | |
sendTo(message.chatId, msgtext); | |
m_rxbuffer = ""; | |
// // Inform the user about parsing error (blocking) | |
// sendTo(message.chatId, "[ERROR] - No memory: inrease buffer size with \"setJsonBufferSize(buf_size)\" method"); | |
return MessageNoData; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment