예제 #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);
            }
        }
예제 #2
0
 internal static void OnThrowErrorMessageException(ErrorMessageException e)
 {
     Assert.Fail(e.Code + ": " + e.Message);
 }