Skip to content

Commit

Permalink
Merge pull request #368 from Telecominfraproject/WIFI-14019-fix-repor…
Browse files Browse the repository at this point in the history
…t-errors-in-strict-only

WIFI-14019: fix: relay errors from ap nos configuration only when strict mode is enabled
  • Loading branch information
i-chvets authored Jul 30, 2024
2 parents b59d1cb + 7be48c3 commit 451680c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RESTAPI/RESTAPI_RPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace OpenWifi::RESTAPI_RPC {
Poco::JSON::Object RetObj;
Cmd.to_json(RetObj);
if (Handler != nullptr)
if (Cmd.ErrorCode){
if (Handler->GetBoolParameter("strict", false) && Cmd.ErrorCode){
return Handler->ReturnObject(RetObj, Poco::Net::HTTPResponse::HTTP_BAD_REQUEST);
}
return Handler->ReturnObject(RetObj);
Expand Down Expand Up @@ -171,7 +171,7 @@ namespace OpenWifi::RESTAPI_RPC {
}

// If the command fails on the device we should show it as failed and not return 200 OK
if (Cmd.ErrorCode) {
if (Handler->GetBoolParameter("strict", false) && Cmd.ErrorCode) {
Logger.information(fmt::format(
"Command failed with error on device: {} Reason: {}.",
Cmd.ErrorCode, Cmd.ErrorText));
Expand Down

0 comments on commit 451680c

Please sign in to comment.