feat(router): Add router configuration to resolve navigation promise on error#48910
Closed
atscott wants to merge 1 commit intoangular:mainfrom
Closed
feat(router): Add router configuration to resolve navigation promise on error#48910atscott wants to merge 1 commit intoangular:mainfrom
atscott wants to merge 1 commit intoangular:mainfrom
Conversation
2ab6d32 to
5e377bd
Compare
alfaproject
reviewed
Feb 2, 2023
bc43f62 to
c993f7a
Compare
c993f7a to
382949d
Compare
14 tasks
f354c4e to
50f7850
Compare
This comment was marked as outdated.
This comment was marked as outdated.
50f7850 to
9b09b31
Compare
931ff6d to
d802911
Compare
…on error With the deprecation of the configurable errorHandler in the Router, there is a missing use-case to prevent the navigation promise from rejecting on an error. This rejection results in unhandled promise rejections. This commit allows developers to instruct the router to instead resolve the navigation promise with 'false', which matches the behavior of other failed navigations. Resolving the Promise would be the ideal default behavior. It is rare that any code handles the navigation Promise at all and even more rare that the Promise rejection is caught. Updating the default value for this option should be considered for an upcoming major version. fixes angular#48902
d802911 to
37f4b39
Compare
AndrewKushnir
approved these changes
Dec 1, 2023
Comment on lines
+721
to
+725
| // TODO(atscott): consider flipping the default behavior of | ||
| // resolveNavigationPromiseOnError to be `resolve(false)` when | ||
| // undefined. This is the most sane thing to do given that | ||
| // applications very rarely handle the promise rejection and, as a | ||
| // result, would get "unhandled promise rejection" console logs. |
dylhunn
approved these changes
Dec 1, 2023
Contributor
dylhunn
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
jessicajaniuk
approved these changes
Dec 1, 2023
Contributor
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
Contributor
|
This PR was merged into the repository by commit 50d7916. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…on error (angular#48910) With the deprecation of the configurable errorHandler in the Router, there is a missing use-case to prevent the navigation promise from rejecting on an error. This rejection results in unhandled promise rejections. This commit allows developers to instruct the router to instead resolve the navigation promise with 'false', which matches the behavior of other failed navigations. Resolving the Promise would be the ideal default behavior. It is rare that any code handles the navigation Promise at all and even more rare that the Promise rejection is caught. Updating the default value for this option should be considered for an upcoming major version. fixes angular#48902 PR Close angular#48910
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…on error (angular#48910) With the deprecation of the configurable errorHandler in the Router, there is a missing use-case to prevent the navigation promise from rejecting on an error. This rejection results in unhandled promise rejections. This commit allows developers to instruct the router to instead resolve the navigation promise with 'false', which matches the behavior of other failed navigations. Resolving the Promise would be the ideal default behavior. It is rare that any code handles the navigation Promise at all and even more rare that the Promise rejection is caught. Updating the default value for this option should be considered for an upcoming major version. fixes angular#48902 PR Close angular#48910
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…on error (angular#48910) With the deprecation of the configurable errorHandler in the Router, there is a missing use-case to prevent the navigation promise from rejecting on an error. This rejection results in unhandled promise rejections. This commit allows developers to instruct the router to instead resolve the navigation promise with 'false', which matches the behavior of other failed navigations. Resolving the Promise would be the ideal default behavior. It is rare that any code handles the navigation Promise at all and even more rare that the Promise rejection is caught. Updating the default value for this option should be considered for an upcoming major version. fixes angular#48902 PR Close angular#48910
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the deprecation of the configurable errorHandler in the Router, there is a missing
use-case to prevent the navigation promise from rejecting on an error. This rejection
results in unhandled promise rejections. This commit allows developers to instruct
the router to instead resolve the navigation promise with 'false', which matches
the behavior of other failed navigations.
Resolving the Promise would be the ideal default behavior. It is rare
that any code handles the navigation Promise at all and even more rare
that the Promise rejection is caught.
fixes #48902