Skip to content

[Bug]: Upload analysis crashes with unhandled "Failed to fetch" error instead of graceful UI feedback #42

Description

@abhishekmanegit

Bug Description

When submitting a retina scan for analysis from the /upload page, the application crashes with an unhandled Failed to fetch error and displays the Next.js error overlay instead of showing a user-friendly error state.

Steps to Reproduce

  1. Navigate to /upload
  2. Fill patient details
  3. Upload an image
  4. Click Execute Analysis
  5. Observe the frontend crash and console error

Expected Behavior

The application should gracefully handle failed API requests by:

  • displaying a proper error message/toast
  • preventing the app from crashing
  • optionally allowing retry functionality

Actual Behavior

The frontend throws an unhandled TypeError: Failed to fetch, exposing the Next.js development error overlay and interrupting the user experience.

Possible Fix

Add proper try/catch handling around the upload request and display a fallback UI or toast notification when the backend/API request fails.

I'd like to work on this issue under GSSoC'26.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions