Exemplo n.º 1
0
        /// <summary>
        /// Nicely format an error we want to present to the user.
        /// </summary>
        private static void PrintUserError(CommandLineApplication app, ErrorMessageException errorMessage)
        {
            app.Error.WriteLine(errorMessage.Message);
            foreach (var line in errorMessage.Data.Keys)
            {
                var value = errorMessage.Data[line]?.ToString();
                if (string.IsNullOrEmpty(value))
                {
                    continue;
                }

                app.Error.WriteLine(line.ToString());
                app.Error.WriteLine("  " + value);
            }
        }
Exemplo n.º 2
0
 internal static void OnThrowErrorMessageException(ErrorMessageException e)
 {
     Assert.Fail(e.Code + ": " + e.Message);
 }