Skip to content

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

@AyushDharDubey

Description

@AyushDharDubey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeasy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions