-
Notifications
You must be signed in to change notification settings - Fork 168
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
fix: make route config errors more prominent #20847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is fine in devMode when adding/renaming a route that conflicts with server running, but gets hidden on clean devMode start as the routes.tsx is generated later and the exception gets thrown.
flow-server/src/main/java/com/vaadin/flow/router/internal/RouteSegment.java
Outdated
Show resolved
Hide resolved
@@ -791,9 +791,9 @@ private RuntimeException ambigousTarget(Class<? extends Component> target) { | |||
|
|||
String messageFormat; | |||
if (isParameter()) { | |||
messageFormat = "Navigation targets must have unique routes, found navigation targets '%s' and '%s' with parameter have the same route."; | |||
messageFormat = "Navigation target paths (considering @Route, @RouteAlias and @RoutePrefix values) must be unique, found navigation targets '%s' and '%s' with parameter having the same route."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As 9 tests failed after updating the message perhaps it would make sense to have these as constants that are also used in the tests.
Quality Gate passedIssues Measures |
When route configuration errors happen, make sure to output the actual error message as the first output at
ERROR
level. When this is detected at startup, we can't prevent printing out the stack trace too since the container does that when initialization throws. Also checked all the messages for different route misconfiguration cases, and they seem to be fine.Fixes #20589