示例#1
0
        /// <summary>
        /// Adds a new Oracle exception message to the message collection of this query.
        /// </summary>
        /// <param name="exc">The Oracle exception to add.</param>

        public void AddMessage(OracleException exc, DatabaseConnection dbase)
        {
            AddMessage(exc);

            if (exc.Errors != null)
            {
                bool hasUserErrors = false;
                foreach (OracleError error in exc.Errors)
                {
                    if (error.Number == 24344)                      // success with compilation error
                    {
                        hasUserErrors = true;
                        break;
                    }
                }

                if (hasUserErrors)
                {
                    messages.AddRange(QueryDriver.GetUserErrors(dbase));
                }
            }
        }
示例#2
0
        /// <summary>
        /// Adds an error message and a collection of Oracle errors to the message
        /// collection of this query.
        /// </summary>
        /// <param name="errmsg">An error message to add.</param>
        /// <param name="errors">The OracleErrorCollection to interperet and add.</param>

        public void AddMessage(string errmsg, OracleErrorCollection errors, DatabaseConnection dbase)
        {
            bool          hasUserErrors = false;
            StringBuilder msg           = new StringBuilder(errmsg);

            foreach (OracleError error in errors)
            {
                msg.Append(CR + "(" + error.Number + ") " + error.Message);

                if (error.Number == 24344)                                      // success with compilation error
                {
                    hasUserErrors = true;
                }
            }

            messages.Add(new Message(Message.MessageType.Info, msg.ToString()));

            if (hasUserErrors)
            {
                messages.AddRange(QueryDriver.GetUserErrors(dbase));
            }
        }
示例#3
0
文件: Query.cs 项目: radtek/Orqa
        /// <summary>
        /// Adds a new Oracle exception message to the message collection of this query.
        /// </summary>
        /// <param name="exc">The Oracle exception to add.</param>

        public void AddMessage(OracleException exc, DatabaseConnection dbase)
        {
            string excMessage = (exc.Message == String.Empty ? exc.StackTrace : exc.Message);

            bool          hasUserErrors = false;
            StringBuilder msg           = new StringBuilder(excMessage);

            foreach (OracleError error in exc.Errors)
            {
                msg.Append(CR + "(" + error.Number + ") " + error.Message);

                if (error.Number == 24344)                                      // success with compilation error
                {
                    hasUserErrors = true;
                }
            }

            messages.Add(new Message(Message.MessageType.Error, msg.ToString()));

            if (hasUserErrors)
            {
                messages.AddRange(QueryDriver.GetUserErrors(dbase));
            }
        }