BlogEngine.Core.Web.Controls.BlogBasePage.OnError C# (CSharp) Method

OnError() protected method

Raises the event.
protected OnError ( EventArgs e ) : void
e System.EventArgs /// An that contains the event data. ///
return void
        protected override void OnError(EventArgs e)
        {
            var ctx = HttpContext.Current;
            var exception = ctx.Server.GetLastError();

            if (exception != null && exception.Message.Contains("callback"))
            {
                // This is a robot spam attack so we send it a 404 status to make it go away.
                ctx.Response.StatusCode = 404;
                ctx.Server.ClearError();
                Comment.OnSpamAttack();
            }

            base.OnError(e);
        }