-
Notifications
You must be signed in to change notification settings - Fork 485
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
Report correct error message for internal server error #6815
Comments
Hello @sainak! I wanted to know if this issue is open for contribution? If that is so, I would really like to work on it. |
hey @jainvedant392, yes this issue is open for contributors |
Thanks a lot for assigning. Could you please provide me an idea for creating the error deliberately, so that i can see the error notification for working on it. |
Since the error code might be coming from the backend API. |
@jainvedant392 I would suggest setting up the backend instance locally and modifying any existing route to throw an error, that should help you test different cases of 5xx being raised by the backend but, the structure of the error response would be the same as 4xx errors. |
Sure, thanks! |
Currently, we show "Something went wrong...!" for all 5xx errors
https://github.com/coronasafe/care_fe/blob/f992917be084ee53a021a957abff49b3fe7abbc0/src/Redux/fireRequest.tsx#L172-L177
but sometimes we need to notify the user the actual error
so we need to check if the response is a proper JSON and show the correct message
The text was updated successfully, but these errors were encountered: