FormatException() public abstract method

public abstract FormatException ( Exception e ) : string
e Exception
return string
示例#1
0
 private void DisplayException(Exception e)
 {
     try
     {
         _console.ForegroundColor = ConsoleColor.Red;
         _console.Error.Write(_objectFormatter.FormatException(e));
     }
     finally
     {
         _console.ResetColor();
     }
 }
示例#2
0
        private void DisplayException(Exception e)
        {
            try
            {
                _console.SetForegroundColor(ConsoleColor.Red);

                if (e is FileLoadException && e.InnerException is InteractiveAssemblyLoaderException)
                {
                    _console.Error.WriteLine(e.InnerException.Message);
                }
                else
                {
                    _console.Error.Write(_objectFormatter.FormatException(e));
                }
            }
            finally
            {
                _console.ResetColor();
            }
        }