Skip to content

Commit

Permalink
fix: relay errors from ap nos configuration only when strict mode is
Browse files Browse the repository at this point in the history
enabled
https://telecominfraproject.atlassian.net/browse/WIFI-14019

Summary of changes:
- Modified code to only relay errors from AP NOS configuration update
  only when strict mode is enabled.

NOTE: AP NOS is capable of modifying config thus fixing invalid configs
(in some cases) and applying resulting configuration. Warning messages
are produced, but error code is being sent back as error/failed.

Signed-off-by: Ivan Chvets <[email protected]>
  • Loading branch information
i-chvets committed Jul 30, 2024
1 parent c3a709c commit 7be48c3
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 7be48c3

Please sign in to comment.