From the course: Security in ASP.NET Core
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Error handling - ASP.NET Tutorial
From the course: Security in ASP.NET Core
Error handling
- [Instructor] In a hypothetical world, you anticipate each error and exception at the very position in the code where they may occur, and therefore, you don't have a problem. In the real world, of course, things look a little bit different. So I would like to give you an overview of error handling features in ASP.NET Core. First, we have error pages. There's the developer exception page that provides a developer-friendly overview over exception details. These details are not just developer-friendly, they're also attacker-friendly, so they should only be available on a development system. So it does check the environment. You've seen that we have the IsDevelopment check here, before we, for instance, set HSTS, and the developer page is activated, and only if we are on the development system, you see it. So we have a development system here. So how about we just try this out? Maybe in the home controller, in the index method, I can't do something like this, var X equals one divided by…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.