-
Notifications
You must be signed in to change notification settings - Fork 307
Startup - Handle Exceptions #486
Comments
Isn't this just a specific way of setting up the request pipeline with a few |
What if the conditions required to initialize policies (authentication) are not configured correctly. I can't see an if statement working all that well since you would have to skip over critical startup code. Not to mention any named policies on controllers and endpoints would cause an immediate crash. The only if I think I would want is a forced response that informs the user of the issue. I don't want the server to be unable to start. |
By default we actually catch all startup exceptions and show an error page (if in development or a flag is set). What more do you need? |
I didn't see this behaviour occurring. Perhaps I haven't configured Startup correctly? Is there specific steps that need to be taken to get this default behaviour? |
@Fosol What do you see then? You should get something like this on beta8 or later (in Development): |
I'm in the middle of migrating a bunch of code to beta8. Just tested it in beta8 - I think that's the behaviour I'm looking for! Thank you. |
From @Fosol on November 17, 2015 23:1
I'd like to know how to handle exceptions on Startup so that I can return an appropriate error page within MVC (if possible).
I also want to be able to check for invalid configuration values and return an appropriate error page. My specific use case is when private keys for authentication and authorization are incorrect or missing. I want to be able to get the server up and running without them but force an error page as the response to any request.
Copied from original issue: aspnet/HttpAbstractions#484
The text was updated successfully, but these errors were encountered: