Ejemplo n.º 1
0
        protected override void OnError(EventArgs e)
        {
            base.OnError(e);
            Exception exc = Server.GetLastError();

            DnnLog.Fatal("An error has occurred while loading page.", exc);

            string strURL = Globals.ApplicationURL();

            if (exc != null && exc is HttpException && !IsViewStateFailure(exc))
            {
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Server.Transfer("~/ErrorPage.aspx");
            }
            if (Request.QueryString["error"] != null)
            {
                strURL += (strURL.IndexOf("?") == -1 ? "?" : "&") + "error=terminate";
            }
            else
            {
                strURL += (strURL.IndexOf("?") == -1 ? "?" : "&") + "error=" + (exc == null || UserController.GetCurrentUserInfo() == null || !UserController.GetCurrentUserInfo().IsSuperUser ? "An unexpected error has occurred" : Server.UrlEncode(exc.Message));
                if (!Globals.IsAdminControl())
                {
                    strURL += "&content=0";
                }
            }
            Exceptions.ProcessPageLoadException(exc, strURL);
        }
Ejemplo n.º 2
0
        void Application_Error(object sender, EventArgs e)
        {
            // Code that runs when an unhandled error occurs

            // Get the exception object.
            DnnLog.Trace("Dumping all Application Errors");
            if (HttpContext.Current != null)
            {
                foreach (Exception exc in HttpContext.Current.AllErrors)
                {
                    DnnLog.Fatal(exc);
                }
            }
            DnnLog.Trace("End Dumping all Application Errors");
        }
Ejemplo n.º 3
0
        private void Application_End(object Sender, EventArgs E)
        {
            DnnLog.MethodEntry();
            DnnLog.Info("Application Ending");
            Initialize.LogEnd();
            Initialize.StopScheduler();

            DnnLog.Trace("Dumping all Application Errors");
            if (HttpContext.Current != null)
            {
                foreach (Exception exc in HttpContext.Current.AllErrors)
                {
                    DnnLog.Fatal(exc);
                }
            }
            DnnLog.Trace("End Dumping all Application Errors");
            DnnLog.Info("Application Ended");
        }