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

Report correct error message for internal server error #6815

Closed
sainak opened this issue Dec 8, 2023 · 6 comments · Fixed by #6873
Closed

Report correct error message for internal server error #6815

sainak opened this issue Dec 8, 2023 · 6 comments · Fixed by #6873
Assignees

Comments

@sainak
Copy link
Member

sainak commented Dec 8, 2023

Currently, we show "Something went wrong...!" for all 5xx errors

if (error.response.status >= 500 && error.response.status <= 599) {
Notification.Error({
msg: "Something went wrong...!",
});
return;
}

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

@jainvedant392
Copy link
Contributor

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.

@sainak
Copy link
Member Author

sainak commented Dec 10, 2023

hey @jainvedant392, yes this issue is open for contributors

@jainvedant392
Copy link
Contributor

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.

@jainvedant392
Copy link
Contributor

Since the error code might be coming from the backend API.

@sainak
Copy link
Member Author

sainak commented Dec 10, 2023

@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.

@jainvedant392
Copy link
Contributor

Sure, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants