Hi folks,
i'm trying to send back a simple error message as Json
, with the HTTP code
as 404
.
So i started out writing my own IExceptionFilter
that checks to see the exception. To keep this simple, if the exception throw is of type ResourceNotFoundException
then i set the code to 404
. Otherwise everything else if 500
.
Now, the problem is .. the default IIS7 404 error message is returned :( my code is called .. but it seems to bypass it (later on in the pipeline)...
is there some trick i need to do?
do I need a custom error handling (in the web config) to be turned on or something?
Edit: I'm trying to do what twitter does. Their Http Response Code documentation shows / explains some examples how they handle 404's, etc.. and i'm wanting to do that in my MVC app.
Edit 2: The code i've done is listed here, for anyones reference :)