Skip to content

docs: correct error-handling details in reference pages - #6323

Merged
peholmst merged 1 commit into
mainfrom
docs/fix-error-handling-reference
Oct 9, 2026
Merged

peholmst merged 1 commit into
mainfrom
docs/fix-error-handling-reference

Conversation

@peholmst

@peholmst peholmst commented Oct 9, 2026

Copy link
Copy Markdown
Member

Fixes six inaccuracies in reference pages about error handling, found while writing the error-handling guide in #6321. Each was checked against the Flow 25.3.3 sources (com.vaadin:flow-server), and the Observability Kit item was also checked against the kit's own bytecode.

Page Was Now
tools/observability/reference.adoc Listed a throwing beforeEnter() among the failures routed to the session error handler Router.navigate() catches every navigation exception and renders an error view through handleExceptionNavigation(), so these never reach the ErrorHandler and vaadin.errors doesn't count them. A short paragraph now says so and points to the navigation timer. In the kit, only ErrorMetricsBinder (the decorated handler) and RequestMetricsBinder (the request interceptor) increment vaadin.errors.
flow/configuration/properties.adoc Documented enableErrorHandlerRedirect (default false) Removed. InitParameters has no such parameter. It was added in vaadin/flow#17791 and removed in vaadin/flow#18105 before 24.3.0 shipped. DefaultErrorHandler.error() always calls ErrorHandlerUtil.handleErrorByRedirectingToErrorView(). The sentence in custom-error-handler.adoc that said this behavior had to be "enabled" is reworded to match.
flow/routing/exceptions.adoc "Only extending instances are allowed." Any HasErrorParameter for the same exception type replaces a @DefaultErrorHandler view, whether it extends it or not (AbstractRouteRegistry.handleRegisteredExceptionType). Two of your own handlers for the same type must be in a subclass relationship (the subclass wins), or startup fails with InvalidRouteConfigurationException. The same paragraph also named two classes that don't exist, ParentLayouts and BeforeNavigationEvent. They're now @ParentLayout and BeforeEnterEvent.
flow/advanced/custom-error-handler.adoc Wrapped Notification.show() in UI.getCurrent().access(), and the message had no space between "occurred." and "Contact" Wrapper removed, because Flow calls the handler with the session locked. Space added.
flow/security/enabling-security.adoc Custom access-denied views returned UNAUTHORIZED (401) FORBIDDEN (403), which fits an authenticated user who lacks permission.
building-apps/ui-basics/show-notification.adoc VaadinIcon.CLOSE_SMALL and ButtonVariant.LUMO_TERTIARY_INLINE VaadinIcon.CLOSE (CLOSE_SMALL is @Deprecated(since = "25.3", forRemoval = true)) and the theme-neutral ButtonVariant.TERTIARY.

Vale reports no alerts on the changed lines.

🤖 Generated with Claude Code

- Observability reference: navigation failures (a throwing beforeEnter()
  or view constructor) never reach the session error handler, because
  Router.navigate() catches them and renders an error view. They aren't
  counted by vaadin.errors; point to the navigation timer instead.
- Configuration properties: remove enableErrorHandlerRedirect. The flag
  was removed before 24.3.0 shipped; DefaultErrorHandler always redirects
  to a matching error view. Reword the matching sentence in Custom Error
  Handling, which implied it had to be enabled.
- Router exceptions: any HasErrorParameter for the same exception type
  replaces a @DefaultErrorHandler view, extending it or not. Only two
  unrelated non-default handlers conflict. Also fix the non-existent
  ParentLayouts and BeforeNavigationEvent names in the same paragraph.
- Custom error handler: drop the unneeded UI.access() wrapper (Flow calls
  the handler with the session locked) and add the missing space in the
  notification message.
- Enabling security: custom access-denied views return 403 FORBIDDEN
  rather than 401 UNAUTHORIZED.
- Show notification: use VaadinIcon.CLOSE instead of CLOSE_SMALL, which
  is deprecated for removal, and the theme-neutral ButtonVariant.TERTIARY
  instead of the Lumo-only LUMO_TERTIARY_INLINE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-6323.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Built from 026d5d0

@peholmst peholmst added the target/v25.3 Automatically cherry-pick to the v25.3 branch label Oct 9, 2026
@peholmst
peholmst merged commit f915d65 into main Oct 9, 2026
11 checks passed
@peholmst
peholmst deleted the docs/fix-error-handling-reference branch October 9, 2026 09:54
peholmst added a commit that referenced this pull request Oct 9, 2026
…v25.3) (#6332)

Co-authored-by: Petter Holmström <petter@vaadin.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked-v25.3 target/v25.3 Automatically cherry-pick to the v25.3 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants