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

Fixed parsedError string handling #4266

Merged
merged 4 commits into from
Jun 17, 2022

Conversation

asteriscos
Copy link
Member

@asteriscos asteriscos commented Jun 15, 2022

Description

This PR fixes a string error handling generated when Wazuh API's request has failed in Wazuh Dev Tools.

Closes #4260

To test it:

  • Go to Wazuh devtools
  • Add agents running this request
POST /agents
{
  "name": "NewAgent3"
}
  • Once agents were added, try to delete them with the request:
    DELETE /agents?agents_list=002&status=all
  • Verify the error can be seen properly in the right textarea (API output)

Other test cases:

  • Inexistent endpoint
  • Wazuh API is down

image

@asteriscos asteriscos requested a review from a team June 15, 2022 14:48
@asteriscos asteriscos self-assigned this Jun 15, 2022
@Desvelao Desvelao linked an issue Jun 16, 2022 that may be closed by this pull request
Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

review:
code ✔️
test ✔️

Screenshot

image

@AlexRuiz7 AlexRuiz7 marked this pull request as draft June 17, 2022 12:06
@AlexRuiz7 AlexRuiz7 marked this pull request as ready for review June 17, 2022 14:17
@github-actions
Copy link
Contributor

Jest Test Coverage % values
Statements 5.49% ( 1997 / 36381 )
Branches 2.27% ( 642 / 28247 )
Functions 3.65% ( 325 / 8897 )
Lines 5.56% ( 1936 / 34799 )

Copy link
Member

@AlexRuiz7 AlexRuiz7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@AlexRuiz7 AlexRuiz7 merged commit 5979464 into 4.3-7.10 Jun 17, 2022
@AlexRuiz7 AlexRuiz7 deleted the fix/wazuh-api-devtools-unhandled-errors-4260 branch June 17, 2022 14:40
github-actions bot pushed a commit that referenced this pull request Jun 17, 2022
* fixed parsedError string handling

* Added changelog

* Add unit test to devtools

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 5979464)
github-actions bot pushed a commit that referenced this pull request Jun 17, 2022
* fixed parsedError string handling

* Added changelog

* Add unit test to devtools

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 5979464)
AlexRuiz7 pushed a commit that referenced this pull request Jun 17, 2022
Fixed parsedError string handling (#4266)

* fixed parsedError string handling

* Added changelog

* Add unit test to devtools

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 5979464)

Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
AlexRuiz7 pushed a commit that referenced this pull request Jun 17, 2022
Fixed parsedError string handling (#4266)

* fixed parsedError string handling

* Added changelog

* Add unit test to devtools

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 5979464)

Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bug issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API console tools does not handle DELETE action
3 participants