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

Add Error Handling for Non-Existent Ticket IDs in Ticket Page #30

Open
AyushDharDubey opened this issue Dec 17, 2024 · 1 comment
Open
Labels
bug Something isn't working easy

Comments

@AyushDharDubey
Copy link
Collaborator

Description:
Currently, the TicketPage doesn't properly handle the case when the id provided does not exist in the system. If the ID doesn't correspond to an existing ticket, the page crashes unexpectedly.

Expected Behavior:

  • If the id does not correspond to any ticket, the user should see a clear error message like "Ticket not found" or be redirected to a custom 404 page.
  • The getTicketById function should handle invalid cases gracefully by returning a null or some indication when the ticket is not found, avoiding any crashes or undefined states.

Steps to Reproduce:

  1. Attempt to access TicketPage with an invalid ticket ID (for eg. try hitting http://localhost:3000/TicketPage/invalid-ticket-id).
  2. Observe that the app breaks.

We need to make sure the getTicketById function correctly handles failure scenarios, including cases where the API does not return a valid ticket, and shows appropriate feedback on the page.

@AyushDharDubey AyushDharDubey added bug Something isn't working easy labels Dec 17, 2024
@MadhavDhall
Copy link
Contributor

Kindly assign this issue to me
My approach:
if getTicketById does not return the desired object then not-found page's component appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy
Projects
None yet
Development

No branches or pull requests

2 participants