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

Feature/error handling and reporting #51

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Tgodmuna
Copy link

@Tgodmuna Tgodmuna commented May 5, 2023

Add specific error handling and Sentry reporting logic

This commit updates the CustomErrorComponent in pages/_error.js to include additional error handling logic based on the error type or status code. It also captures errors with Sentry for improved error reporting.

Specific changes include:

  • Added handling for 404 errors with custom message
  • Added try-catch block to getInitialProps to catch and report errors with Sentry
  • Updated comments for clarity

Note: This implementation assumes the use of @sentry/nextjs version 7.3.0 or higher.

This commit updates the `CustomErrorComponent` in `pages/_error.js` to include additional error handling logic based on the error type or status code. It also captures errors with Sentry for improved error reporting.

Specific changes include:
- Added handling for 404 errors with custom message
- Added try-catch block to `getInitialProps` to catch and report errors with Sentry
- Updated comments for clarity

Note: This implementation assumes the use of `@sentry/nextjs` version 7.3.0 or higher.
Refactor UserDetails component for better readability and maintainability

Destructured user prop in function argument
Used nullish coalescing operator for avatar and handle props
Moved useFragment query to its own constant and reformatted for better readability
Renamed Props type to UserDetailsProps
Extracted GitStats component from UserDetails
Added aria-label to icon elements for accessibility
Reformatted code for consistent indentation and spacing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant