Esempio n. 1
0
        public static string Format(this BatchParserExecutionErrorEventArgs args, string source)
        {
            var outputMessageBuilder = new StringBuilder();

            outputMessageBuilder.Append(source);
            outputMessageBuilder.Append('(');
            outputMessageBuilder.Append(args.Line);
            outputMessageBuilder.Append(',');
            outputMessageBuilder.Append(args.TextSpan.iStartIndex);
            outputMessageBuilder.Append("): ");
            outputMessageBuilder.Append("error: ");

            if (args.Exception != null)
            {
                outputMessageBuilder.Append(args.Message);
            }
            else if (args.Error != null)
            {
                outputMessageBuilder.Append("SQL");
                outputMessageBuilder.Append(args.Error.Number);
                outputMessageBuilder.Append(": ");
                outputMessageBuilder.Append(args.Error.Message);
            }
            else
            {
                outputMessageBuilder.Append(args.Message);
                outputMessageBuilder.Append(' ');
                outputMessageBuilder.Append(args.Description);
            }

            return(outputMessageBuilder.ToString());
        }
Esempio n. 2
0
 private void OnBatchParserExecutionError(object sender, BatchParserExecutionErrorEventArgs args)
 {
     if (args != null)
     {
         Logger.Write(LogLevel.Verbose, SR.BatchParserWrapperExecutionError);
         throw new Exception(SR.BatchParserWrapperExecutionEngineError);
     }
 }
 private void OnBatchParserExecutionError(object sender, BatchParserExecutionErrorEventArgs args)
 {
     if (args != null)
     {
         Logger.Write(TraceEventType.Verbose, SR.BatchParserWrapperExecutionError);
         throw new Exception(string.Format(CultureInfo.CurrentCulture,
                                           SR.BatchParserWrapperExecutionEngineError, args.Message + Environment.NewLine + '\t' + args.Description));
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Called when batch pasing found a warning/error
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 static void OnBatchParserExecutionError(object sender, BatchParserExecutionErrorEventArgs e)
 {
     Console.WriteLine("ON_BATCH_PARSER_EXECUTION_ERROR : {0} found... at line {1}: {2}", e.MessageType.ToString(), e.Line.ToString(), e.Message);
     Console.WriteLine("\t Error Description: " + e.Description);
     parserExecutionError = true;
 }