Rocco
Custom 400 return type (application/fhir+xml)
Currently working on an API that has to be FHIR compliant. FHIR has it's own conventions for dealing with for example a 400.
I wrote a middleware to handle with these. It works fine for 401,403 and 404 errors. However as soon as I attempt this on a 400 I get this exception:
The code used to write the custom error to the response:
This is the same code in the same loccation that also handles the 404 errors. And for those it works perfect. It seems ASP starts writing the instant a controller method returns a "BadRequest". How do I stop that behaviour?
10 replies