Injected Error handler in API responses #449
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Right now, the error handlers were not added to the responses of API. Any HTTP status apart from 200 is not to the worth so, for any other response code, we can show the dialog box that server has gone away or something similar.
Code snippet
This simple code has been used around API responses
Related Issue
#351
How Has This Been Tested?
I tested it by manually switching the server down and on the server down, it shows the pop-up. I tried without authentication and it was catching 403 error perfectly, showing a pop-up to login back.
Screenshots (In case of UI changes):
Types of changes
Checklist:
Signed-off-by: Nirmal Sarswat [email protected]