Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router): withNavigationErrorHandler can convert errors to redi… #55370

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Apr 16, 2024

…rects

This commit adds the ability to return RedirectCommand from the error handler provided by withNavigationErrorHandler. This will prevent the error from being surfaced in the events observable of the Router and instead convert the error to a redirect. This allows developers to have more control over how the Router handles navigation errors. There are some cases when the application does not want the URL to be reset when an error occurs.

resolves #42915

@atscott atscott added the target: minor This PR is targeted for the next minor release label Apr 16, 2024
@ngbot ngbot bot added this to the Backlog milestone Apr 16, 2024
@atscott atscott requested review from AndrewKushnir and removed request for pkozlowski-opensource, thePunderWoman and dylhunn April 16, 2024 20:50
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Apr 16, 2024
Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Apr 17, 2024
…rects

This commit adds the ability to return `RedirectCommand` from the error
handler provided by `withNavigationErrorHandler`. This will prevent the
error from being surfaced in the `events` observable of the Router and
instead convert the error to a redirect. This allows developers to
have more control over how the Router handles navigation errors. There
are some cases when the application _does not_ want the URL to be reset
when an error occurs.

resolves angular#42915
@atscott atscott force-pushed the errorHandlerRedirectFeature branch from efe3240 to e5479b7 Compare April 17, 2024 16:04
@AndrewKushnir AndrewKushnir removed the request for review from thePunderWoman April 17, 2024 17:18
@alxhub
Copy link
Member

alxhub commented Apr 17, 2024

This PR was merged into the repository by commit 4a42961.

@alxhub alxhub closed this in 4a42961 Apr 17, 2024
iteriani pushed a commit to iteriani/angular that referenced this pull request Apr 18, 2024
…rects (angular#55370)

This commit adds the ability to return `RedirectCommand` from the error
handler provided by `withNavigationErrorHandler`. This will prevent the
error from being surfaced in the `events` observable of the Router and
instead convert the error to a redirect. This allows developers to
have more control over how the Router handles navigation errors. There
are some cases when the application _does not_ want the URL to be reset
when an error occurs.

resolves angular#42915

PR Close angular#55370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: router detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to not reset Url and Router state to Angular Router on Navigation Errors
5 participants