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

Adds error handling in networkRequest #154

Merged

Conversation

lodi-g
Copy link

@lodi-g lodi-g commented Oct 26, 2023

Sometimes the requets fails randomly and/or the content type is not json. The lack of error handling makes consumers unable to catch the error to see what went wrong.

This commit adds error handling for both cases when the request fails (status !== 2xx) and when the content-type is not json.

I'd recommend to test it on your side as well because the behavior of the backend is not entirely known by me.

Sometimes the requets fails randomly and/or the content type is not json.
The lack of error handling makes consumers unable to catch the error to see what went wrong.

This commit adds error handling for both cases when the request fails (status !== 2xx)
and when the content-type is not json.
@lodi-g lodi-g requested a review from a team as a code owner October 26, 2023 18:31
Copy link
Member

@zemberdotnet zemberdotnet left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @lodi-g. If you're ready I can merge this.

@lodi-g
Copy link
Author

lodi-g commented Oct 26, 2023 via email

@zemberdotnet zemberdotnet merged commit 5969dab into JupiterOne:main Oct 26, 2023
5 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.

2 participants