Skip to content
This repository was archived by the owner on Dec 8, 2018. It is now read-only.
This repository was archived by the owner on Dec 8, 2018. It is now read-only.

Provide in-the-box handling for page vs. API errors #427

@breyed

Description

@breyed

Currently, a fair amount of configuration is required to report errors in a native format for pages vs. web API. It would be nice to have the following features:

  • A way to tell MVC what routes go to pages vs. APIs.
  • Automatic response of HTML error pages for page routes, and empty-or-JSON bodies for API routes.
  • Inclusion of status codes from exceptions in API responses (avoids the need to always use IActionResult, which minimizes friction in unit testing web API methods).
  • Automatic suppression of authentication redirects for API routes.

Currently, I provide these features like this (and like this for redirects, but it seems like something that would be quite useful to have baked in from the start.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions