Skip to content

Conversation

@ManojTauro
Copy link

Fixes: #655

This pull request resolves the issue of the tornjak UI displaying a blank screen when it fails to connect to the
backend. It introduces a global error boundary mechanism to gracefully handle server connection failures and
provide a clear, user-friendly error message.

Description

Previously, if the backend was unreachable, asynchronous errors from API calls were not properly caught, leading
to a crashed render and a blank white page for the user.

This PR implements the following changes:

  1. Global Error Boundary:

    • A new GlobalErrorBoundary component has been created to act as a centralized error handler.
    • This component is designed to catch errors and display a fallback UI instead of a blank screen.
  2. Server-Side Error Detection:

    • The error boundary integrates with the existing Axios setup (setServerDownHandler).
    • A global Axios interceptor now detects network errors on API requests. When a connection failure occurs, it
      updates the state of the GlobalErrorBoundary.
  3. User-Friendly Error Component:

    • When the error boundary detects a server connection error, it now renders a dedicated
      component. This component informs the user about the connection issue and provides an option to reload the
      page.
  4. Code Refinements:

    • The error handling logic was refactored to focus specifically on server unreachable errors, as per the
      scope of the issue. We can extend this logic to handle any JavaScript run time errors if needed.

Manoj Balaraj and others added 6 commits June 27, 2025 21:02
Signed-off-by: manu2931 <[email protected]>
Signed-off-by: manu2931 <[email protected]>
Signed-off-by: manu2931 <[email protected]>
Signed-off-by: manu2931 <[email protected]>
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.

Blank Screen on Backend Connection Failure

1 participant