Basically, I am trying to write the following (pseudocode) in an ASP.NET HttpModule:
*pre-code*
try { handler.ProcessRequest(...) }
catch (Exception) { *error-code* }
finally { *post-code* }
I found that I can connect to HttpModule.PreExecuteHandler for "pre-code" and .Error for "error code". But PostExecuteHandler does not seem to work reliably.
BeginRequest and EndRequest work reliably, but it's too early for the code I need to write, which requires checking the handler that was selected to execute. A handler is not selected until BeginRequest.
Is there any best practice for writing this type of wrapper?
Thank!
source
share