-
Notifications
You must be signed in to change notification settings - Fork 2.1k
RazorPages page directives missing quotes should alert user #5868
Comments
This should be a parsing error coming from Razor. |
aspnet/Razor#980 is the proper issue for this. |
There are three distinct cases to consider:
The work for this item is:
|
(1) already logs and has a test here. Do we want a functional test for it in MVC as well or is that enough? (2) When you say not a valid route how do you mean? Do you just mean something like It doesn't sound like you want anything done for (3), but for posterity how would we know if it's "not what you meant". |
|
@ajaybhargavb \ @NTaylorMullen, doesn't the directive parser already validate this? |
At the very least we need to make sure we have tests for all the scenarios listed here: #5868 (comment) |
@pranavkm It sees the problem but it doesn't log the issue anywhere. Essentially the error goes nowhere. |
This means |
@rynowak - would Razor depend on Logging or would we add diagnostics with error levels and print them from Mvc? |
Razor will not depend on logging.
I'm not convinced that what we're discussing here is complicated. If it is complicated, then we can probably punt this or close it. |
@rynowak - if Razor doesn't depend on logging, how does the "log" flow to the user's ILoggerFactory? |
It comes from |
Ah ok. |
Edit: Reopening after some discussion.
The issue here is that if we can't parse the route we can't assign what the user 'expects' the route to be to the page. So if the user can't visit the page because it doesn't get the URL that they expect, then how will they know that it's invalid?
Original
As per #5838 (comment) we should have a think about how we handle the case of
@page Url/Here
. Right now we ignore the URL because it's not in quotes, but there's some concern that that will confuse the users and that we should either throw an exception or at least log a message.The text was updated successfully, but these errors were encountered: