Jul 21, 2010, 9:27 PM
[CLOSED] [1.0] Global error handling of DirectMethods
I am able to implement global error handling for DirectEvents since they run through normal asp.net page life cycle. However, I am not able to globally handle shared/static DirectMethods. When an error occurs, the Global.asax's Application_Error event does not fire. Looking in DirectRequestModule.cs, I notice that any DirectMethods exception is handled by Ext.net. Is it possible to expose a way for me to hook into that? It was suggested that I catch the error on the clientside, but that is not ideal. I need to log the error to the database because we track and log every exception thrown in the application. Firing off another DirectMethod to just log the error seems a little goofy to me. What if that DirectMethod fails too? Then it will go into an infinite loop.
DirectRequestModule.cs
DirectRequestModule.cs
private void ProcessRequest(HttpApplication app, HttpRequest request)
{
DirectResponse responseObject = new DirectResponse(true);
try
{
// ... do stuff
}
catch (Exception e)
{
// I want a hook into here!!!! So I can log the exception to the database for history/tracking purposes. This must occur on serverside and not clientside.
responseObject.Success = false;
responseObject.ErrorMessage = IsDebugging ? e.ToString() : e.Message;
}
// ... process request
app.CompleteRequest();
}
Last edited by Daniil; Jul 26, 2010 at 9:24 AM.