protected void Application_Error() { Exception exception = Server.GetLastError(); if (exception != null) { var adapter = Helpers.Helper.GetDataAccessAdapter(); ErrorEntity.LogException(adapter, exception); } }