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

Show correct error message for interval server errors #6856

Closed
wants to merge 10 commits into from

Conversation

jainvedant392
Copy link
Contributor

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@jainvedant392 jainvedant392 requested a review from a team as a code owner December 12, 2023 18:15
Copy link

vercel bot commented Dec 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 15, 2023 3:23pm

Copy link

netlify bot commented Dec 12, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit e9cc608
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/657c6f5b4e4e9d00084d5d96
😎 Deploy Preview https://deploy-preview-6856--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@rithviknishad rithviknishad left a 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)

@jainvedant392
Copy link
Contributor Author

Ok sure, I'll update the same in request.tsx.

@jainvedant392
Copy link
Contributor Author

Is "src/Utils/request/request.ts" this the file we are taking about?

@rithviknishad
Copy link
Member

yes, to be precise: src/Utils/request/handleResponse.ts

@jainvedant392
Copy link
Contributor Author

Sure, I'll make the requested changes.

@jainvedant392
Copy link
Contributor Author

made the changes

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +173 to +181
if (error.response.data && error.response.data.detail) {
Notification.Error({
msg: error.response.data.detail,
});
} else {
Notification.Error({
msg: "Something went wrong...!",
});
}
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

@jainvedant392

https://github.com/coronasafe/care_fe/pull/6856/files/326338e00b99ccd72d3e5ad8c9122f53032d7377#diff-e2c5c73d556d02503d5adc253828ddf5bad94f6fb9fba25df333d5ca6b9b5c56R152

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?

Copy link
Contributor Author

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.

@nihal467
Copy link
Member

@sainak can you comment on this

@sainak
Copy link
Member

sainak commented Dec 14, 2023

@sainak can you comment on this

Code changes suggested, to reduce duplication

@jainvedant392
Copy link
Contributor Author

Sure, I'll make the requested changes.

@jainvedant392
Copy link
Contributor Author

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?

@rithviknishad
Copy link
Member

sure!

@jainvedant392
Copy link
Contributor Author

Thanks for that, I'll do that soon.

@jainvedant392
Copy link
Contributor Author

Hey @rithviknishad, I have made another PR to this issue with the same changes as the previous PR. Please review it.
#6873

@sainak sainak closed this Dec 15, 2023
@jainvedant392 jainvedant392 deleted the issue6815 branch December 15, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report correct error message for internal server error
4 participants