O'Reilly logo

Expert ASP.NET Web API 2 for MVC Developers by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 25

image

Error Handling

In this chapter, I complete my description of the Web API dispatch process by showing how errors are handled. I’ll show you the different ways you can deal with problems that you anticipate during development and what happens when unexpected problems arise. I explain how to control the response that is sent to the client and how to manage and log unhandled exceptions for the entire application. Table 25-1 summarizes this chapter.

Table 25-1. Chapter Summary

Problem

Solution

Listing

Trigger the default error handling policy.

Throw an exception from an action method or filter.

1–3

Throw an exception that generates a specific ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required