From the course: Learning ASP.NET Core MVC
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Error handling and diagnostics
From the course: Learning ASP.NET Core MVC
Error handling and diagnostics
- [Narrator] Now that I've shown you how to use ASP.NET Core's middleware to execute server side logic and serve static content, I'm going to get a little paranoid for a bit and show you how to register error handling logic to try and help salvage your user's experience when something in your application inevitably goes wrong. To demonstrate an error, I'll just add a bit of code to the configure method in the startup class that throws an exception when the URL contains the word: invalid. Then I'll run the site and navigate to a URL like /invalid. Here I'm greeted by an incredibly helpful error message containing all kinds of useful information to help me figure out what went wrong with my application. At the top, it shows me the error message and then lower down I can click on various sections of the stack trace and, if it's my code, I can actually see that code right there in my browser. In addition to the stack trace information, the page also has several other tabs that allow me to…
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.
Contents
-
-
-
Building blocks of ASP.NET Core applications5m 54s
-
Create a new project4m 44s
-
Respond to HTTP requests5m 32s
-
Serving static files2m 18s
-
Error handling and diagnostics4m 55s
-
Use custom configuration4m 21s
-
Populate configuration settings3m 9s
-
Increase maintainablility with dependency injection5m 53s
-
-
-
-
-
-
-