-
Notifications
You must be signed in to change notification settings - Fork 347
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
Show correct error message for interval server errors #6856
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, however same needs to be updated in request.ts
as that is the newer version which we are slowly adopting. (As we are planning to drop usage of react-redux)
Ok sure, I'll update the same in request.tsx. |
Is "src/Utils/request/request.ts" this the file we are taking about? |
yes, to be precise: |
Sure, I'll make the requested changes. |
made the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if (error.response.data && error.response.data.detail) { | ||
Notification.Error({ | ||
msg: error.response.data.detail, | ||
}); | ||
} else { | ||
Notification.Error({ | ||
msg: "Something went wrong...!", | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it could be handled by the 4xx code block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But issue was to check it for the internal server errors, i.e. 5xx errors as well. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just setting the upper limit to < 600
instead of < 400
should work right?
Because it looks like the 4xx code block handles the error the same as what you've done in 5xx code block. We could just remove the 5xx code block and tweak the 4xx code block to cover both 4xx and 5xx right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that would be right. I'll make the changes.
@sainak can you comment on this |
Code changes suggested, to reduce duplication |
Sure, I'll make the requested changes. |
I am getting a problem in pushing the latest committed changes from my local branch, I tried but was unable to resolve it. So, can I make another PR with a different branch having the same changes as requested in this issue? |
sure! |
Thanks for that, I'll do that soon. |
Hey @rithviknishad, I have made another PR to this issue with the same changes as the previous PR. Please review it. |
Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist