OllieDay / DeveloperExceptionText

Middleware that captures synchronous and asynchronous exceptions from the pipeline and generates text error responses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DeveloperExceptionText

Middleware that captures synchronous and asynchronous exceptions from the pipeline and generates text error responses.

Overview

The ASP.NET Core DeveloperExceptionPageMiddleware generates HTML error responses which are less helpful in a Web API project accessed via a REST client. This middleware instead returns error responses in plain text that is easier to read.

Getting started

Install the NuGet package into your application.

Package Manager

Install-Package DeveloperExceptionText

.NET CLI

dotnet add package DeveloperExceptionText

Usage

Add the following to the Configure method in the Startup class.

if (env.IsDevelopment())
{
	app.UseDeveloperExceptionText();
}

Put UseDeveloperExceptionText before any middleware you want to catch exceptions in, such as app.UseMvc.

About

Middleware that captures synchronous and asynchronous exceptions from the pipeline and generates text error responses

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C# 100.0%