From 512509c2e26651d00b1677a77ada12e4428efc66 Mon Sep 17 00:00:00 2001 From: Phat Nguyen Date: Sun, 10 Mar 2024 08:44:49 +0700 Subject: [PATCH] Print HTTP Response in logs in case of error --- examples/BASIC/BASIC.ino | 2 ++ examples/ONE/ONE.ino | 2 ++ examples/Open_Air/Open_Air.ino | 2 ++ 3 files changed, 6 insertions(+) diff --git a/examples/BASIC/BASIC.ino b/examples/BASIC/BASIC.ino index 383f158..45c29d7 100644 --- a/examples/BASIC/BASIC.ino +++ b/examples/BASIC/BASIC.ino @@ -249,6 +249,8 @@ public: if ((retCode == 200) || (retCode == 429)) { serverFailed = false; return true; + } else { + Serial.printf("Post response failed code: %d\r\n", retCode); } serverFailed = true; return false; diff --git a/examples/ONE/ONE.ino b/examples/ONE/ONE.ino index 3370916..fce9869 100644 --- a/examples/ONE/ONE.ino +++ b/examples/ONE/ONE.ino @@ -338,6 +338,8 @@ public: if ((retCode == 200) || (retCode == 429)) { serverFailed = false; return true; + } else { + Serial.printf("Post response failed code: %d\r\n", retCode); } serverFailed = true; return false; diff --git a/examples/Open_Air/Open_Air.ino b/examples/Open_Air/Open_Air.ino index e704857..49cb36d 100644 --- a/examples/Open_Air/Open_Air.ino +++ b/examples/Open_Air/Open_Air.ino @@ -339,6 +339,8 @@ public: if ((retCode == 200) || (retCode == 429)) { serverFailed = false; return true; + } else { + Serial.printf("Post response failed code: %d\r\n", retCode); } serverFailed = true; return false;