Skip to content

Do not redirect users to error pages #1478

@Gleb-Shipilov

Description

@Gleb-Shipilov

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

No response

Describe the feature you're interested in

User story

As a Kafka UI user,
If I don't have access to a resource, it doesn't exist, or there are other problems,
I want to see the error on the same page instead of being redirected to a 404/403 page,
So that when the reason is fixed, I can just update the page and see my resource.

Background:

Given I am an authenticated user in the Kafka UI
And the application is designed to show resource details on specific URLs (e.g., /topics/, /consumer-groups/)

Scenario: Navigating to a non-existent resource (404 Not Found)

Given a Kafka Topic named "my-missing-topic" does not exist
When I navigate directly to the URL "/topics/my-missing-topic"
Then I should NOT be redirected to a generic "/404" error page
And the browser's URL bar must remain "/topics/my-missing-topic"
And the main application UI (like the header, navigation sidebar, etc.) should remain visible
And the main content area (where topic details would normally appear) should display a clear error message, such as "Topic 'my-missing-topic' not found." or "Resource not found."

Scenario: Navigating to a resource without permission (403 Forbidden)

Given a Kafka Topic named "protected-topic" exists
And I do not have the necessary permissions to view this topic
When I navigate directly to the URL "/topics/protected-topic"
Then I should NOT be redirected to a generic "/403" or "/login" page
And the browser's URL bar must remain "/topics/protected-topic"
And the main application UI (like the header and sidebar) should remain visible
And the main content area should display a clear error message, such as "Access Denied: You do not have permission to view this resource."

Scenario: Navigating to a resource that experiences a server error (5xx)

Given a Connector named "failing-connector" exists
When I navigate to "/connect/failing-connector"
And the API returns an internal server error (e.g., 500, 503) while trying to fetch its details
Then I should NOT be redirected
And the browser's URL bar must remain "/connect/failing-connector"
And the main application UI should remain visible
And the main content area should display an error message, such as "An unexpected error occurred. Please try again."
And the error message may include an option to "Retry" the request.

Scenario: The "Fix and Refresh" workflow (Resource is created)

Given I am currently on the URL "/topics/my-new-topic"
And I am seeing an inline error message "Topic 'my-new-topic' not found." (as per Scenario 1)
When an administrator creates the "my-new-topic" in Kafka in the background
And I press the browser's refresh button (or F5)
Then the "Topic not found" error message should disappear
And the page should successfully load and display the details for "my-new-topic"

Scenario: The "Fix and Refresh" workflow (Permissions are granted)

Given I am currently on the URL "/topics/protected-topic"
And I am seeing an inline error message "Access Denied..." (as per Scenario 2)
When an administrator grants me the required permissions in the background
And I press the browser's refresh button (or F5)
Then the "Access Denied" error message should disappear
And the page should successfully load and display the details for "protected-topic"

Describe alternatives you've considered

No response

Version you're running

6474fb6

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions