private void Application_OnError(object source, EventArgs e)
        {
            HttpApplication application = (HttpApplication)source;
            HttpContext     context     = application.Context;
            CustomException lastError   = context.Server.GetLastError() as CustomException;

            if (lastError == null)
            {
                lastError = context.Server.GetLastError().GetBaseException() as CustomException;
            }
            try
            {
                if (lastError != null)
                {
                    switch (lastError.ExceptionType)
                    {
                    case PEExceptionType.NoSuchUser:
                    case PEExceptionType.PasswordNotMatch:
                    case PEExceptionType.LockedUser:
                    case PEExceptionType.ConnectionFalse:
                    case PEExceptionType.SameCard:
                    case PEExceptionType.NotenoughMoney:
                        lastError.Log();
                        goto Label_01E0;
                    }
                }
                else
                {
                    Exception innerException = context.Server.GetLastError();
                    if (innerException.InnerException != null)
                    {
                        innerException = innerException.InnerException;
                    }
                    if (innerException is HttpException)
                    {
                        HttpException exception3 = (HttpException)innerException;
                        if (exception3.GetHttpCode() == 0x194)
                        {
                            return;
                        }
                    }
                    SqlException exception4 = innerException as SqlException;
                    if (exception4 == null)
                    {
                        lastError = new CustomException(PEExceptionType.UnknownError, innerException.Message, context.Server.GetLastError());
                        lastError.Log();
                    }
                    else
                    {
                        StringBuilder builder = new StringBuilder();
                        for (int i = 0; i < exception4.Errors.Count; i++)
                        {
                            builder.Append(string.Concat(new object[] { "Index #", i, "\nMessage: ", exception4.Errors[i].Message, "\nLineNumber: ", exception4.Errors[i].LineNumber, "\nSource: ", exception4.Errors[i].Source, "\nProcedure: ", exception4.Errors[i].Procedure, "\n" }));
                        }
                        lastError = new CustomException(PEExceptionType.UnknownError, builder.ToString());
                    }
                }
            }
            catch
            {
            }
Label_01E0:
            if (((lastError != null) && (lastError.ExceptionType == PEExceptionType.BllError)) || (CompilationDebug() != CustomErrorsMode.Off))
            {
                PEEvents.PEException(lastError);
            }
        }