Beispiel #1
0
 /// <summary>
 /// Write the error information.
 /// </summary>
 /// <param name="tw">TextWriter to write the information.</param>
 /// <param name="error">Error information.</param>
 private void writeErrorLogEntry(TextWriter tw, IError error)
 {
     if (!this.showMessages)
     {
         return;
     }
     try {
         ErrorAdapter errorAdapter = error as ErrorAdapter;
         if (errorAdapter != null)
         {
             writeError(errorAdapter.Location.ToString(), tw);
             writeError(": Error " + errorAdapter.GetType().FullName + " (" + errorAdapter.ErrorType + "). ", tw);
             writeError(errorAdapter.Description + "\n", tw);
         }
         else
         {
             writeError("Error: ", tw);
             writeError(error.ErrorType + "\r\n", tw);
             writeError("Description: ", tw);
             writeError(error.Description + "\r\n", tw);
         }
         tw.Flush();
     } catch (IOException e) {
         Console.Error.WriteLine("[ErrorManager]: It has not been possible to write in error log.");
         Console.Error.WriteLine(e.Message);
         Environment.Exit(-1);
     }
 }
        public override bool Equals(object obj)
        {
            ErrorAdapter error = obj as ErrorAdapter;

            if (error == null)
            {
                return(false);
            }
            return(error.description.Equals(this.description) && location.Equals(error.location));
        }