3
Situation
I’m working on one Httpmodule who is responsible for monitoring usage patterns and intercepting and managing untreated exceptions in ASP.NET applications via events BeginRequest
, EndRequest
and Error
of the current context of HttpApplication
.
Question
Is there any direct and already implemented way to map exceptions of the . NET platform for its HTTP equivalents? I can imagine that some maps would be:
FileNotFoundException > 404 File Not Found
UnauthorizedAccessException > 403 Forbidden
AuthenticationException > 401 Unauthorized
[...]
(Qualquer outra exceção) > 500 Internal Server Error
I don’t want to reinvent the wheel, and prefer to use some function already implemented (preferably native to the platform).
Its system is ASP.NET MVC?
– Leonel Sanches da Silva
@Gypsy omorrisonmendez Actually no, Morrison - the current implementation is completely agnostic, Saas.
– OnoSendai
Well, if I followed the MVC pattern I had a quick response.
– Leonel Sanches da Silva