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

DeveloperExceptionPageMiddleware always returns HTML, sometimes JSON would be better #346

Closed
tjrobinson opened this issue Feb 3, 2017 · 3 comments

Comments

@tjrobinson
Copy link

We're using the DeveloperExceptionPageMiddleware and it would be really useful if it could be changed/configured so that AJAX requests to APIs, e.g. from an Angular application were given a JSON response back instead of HTML. This would make the response much more readable when using F12 tools or testing the API through other non-browser tools like Postman.

I hope that's enough information to make sense, let me know if not.

There's a similar problem discussed here: http://stackoverflow.com/questions/35245893/mvc-6-webapi-returning-html-error-page-instead-of-json-version-of-exception-obje

Thanks!

@davidfowl
Copy link
Member

Feels like we could do this as part of the new API work @rynowak.

/cc @Eilon

@rynowak
Copy link
Member

rynowak commented Aug 7, 2017

https://tools.ietf.org/html/rfc7807

And then you want formatters and get bit by the layering bug 😆

@aspnet-hello
Copy link

This issue was moved to dotnet/aspnetcore#2590

@aspnet aspnet locked and limited conversation to collaborators Jan 2, 2018
@aspnet-hello aspnet-hello removed this from the 2.1.0-preview2 milestone Jan 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants