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

Error handling for EditContactUs page #284

Closed
kwajiehao opened this issue Dec 8, 2020 · 0 comments · Fixed by #290
Closed

Error handling for EditContactUs page #284

kwajiehao opened this issue Dec 8, 2020 · 0 comments · Fixed by #290
Labels
P2 Important, but not urgent. Do it when have time.

Comments

@kwajiehao
Copy link
Contributor

Currently, error handling for the EditContactUs page is lacking in sophistication.

  1. We have multiple async API calls in the same try-catch block, so when one of them fails, we don't actually know which one is the cause.
      const settingsResp = await axios.get(`${process.env.REACT_APP_BACKEND_URL}/sites/${siteName}/settings`)
      const { footerContent, footerSha } = settingsResp.data.settings;
      
      const contactUsResp = await axios.get(`${process.env.REACT_APP_BACKEND_URL}/sites/${siteName}/pages/contact-us.md`);
      const { content, sha } = contactUsResp.data;
  1. In the catch block, we simply redirect to the Not Found page if there are any errors (PR Feat/add 404 and generic error pages #280). We should redirect to the Not Found page only when the Contact Us file cannot be found (404 from the Contact Us page api call only). Any other error that arises should be dealt with with an error toast notification (PR Error-handling: toast notifications #279)
@kwajiehao kwajiehao added the P2 Important, but not urgent. Do it when have time. label Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important, but not urgent. Do it when have time.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant