Hi there,
We're seeing more and more issues with errors in Razor templates; either because of a parser error (which we can usually fix ourselves) or a runtime error. As an example, I attached a SQL time out error that happened when accessing an area item.
Unfortunately, these errors are sent back with a 200 OK status so there isn't anything we can do to capture them other than wrap all of our code in try/catch blocks.
Could this be resolved somehow? I see a few options:
1. Return a proper 500 Server error code. This would allow us to intercept the exception and display a custom error page and log the error.
2. Provide a "On Razor Exception" type of notification subscriber. This would make it easy to change the behavior of how Razor works without affecting existing solutions. In the subscriber we could log the error and then send the user to an appropriate error page.
Any thoughts?
Imar