Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIFI-13985: commands API will return 400 if command fails on device. #366

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

i-chvets
Copy link
Contributor

Description:
Command failure on device causes API to return 400 instead of 200

Jira: https://telecominfraproject.atlassian.net/browse/WIFI-13985

Cherry-pick of commit from fork.

Summary of Changes:

  • When Cmd.ErrorCode is non-zero (zero means success on device) return early into SetCommandStatus
  • Update Handler->ReturnObject to take an optional HTTP status code to return (defaults to 200 so no other uses of this method are changed)
  • When Cmd.ErrorCode is non-zero SetCommandStatus will return 400 status code along with the full request body that would have been returned previously with the 200 status code.

@i-chvets i-chvets requested a review from carsten989 July 26, 2024 17:22
Copy link
Contributor

@carsten989 carsten989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@i-chvets i-chvets merged commit b59d1cb into master Jul 26, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants