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

Fix react router error handling and set up logging #125

Open
ryanchristo opened this issue Jul 27, 2023 · 0 comments
Open

Fix react router error handling and set up logging #125

ryanchristo opened this issue Jul 27, 2023 · 0 comments
Labels
dev Engineering task help wanted Extra attention is needed

Comments

@ryanchristo
Copy link
Member

src/components/organisms/error-fallback.tsx

export const ErrorFallback = () => {
  const error = useRouteError()
  // TODO: `toErrorWithMessage` was added before react-router 6.4 upgrade -
  // there's probably a more graceful solution. See:
  // https://reactrouter.com/en/main/route/error-element
  // const error = toErrorWithMessage(routeErr)

  console.error(error) // eslint-disable-line no-console

  ...

src/util/errors.ts

function reportError({ message }: { message: string }): void {
  // TODO - set up logging?
  console.error(message)
}
@ryanchristo ryanchristo added dev Engineering task help wanted Extra attention is needed labels Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Engineering task help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant