private static bool HandleAssemblyUpdaterErrors(IEnumerable <AssemblyUpdaterUpdateTask> allTasks) { var tasksWithErrors = allTasks.Where(t => APIUpdaterAssemblyHelper.IsError(t.Result) || t.Exception != null); if (!tasksWithErrors.Any()) { return(false); } var sb = new StringBuilder(L10n.Tr("Unable to update following assemblies:")); foreach (var updaterTask in tasksWithErrors) { sb.AppendFormat("{1} (Name = {2}, Error = {3}) (Output: {4}){0}{5}{0}{6}{0}", Environment.NewLine, updaterTask.Candidate.Path, updaterTask.Candidate.Name, updaterTask.Result, updaterTask.OutputPath, updaterTask.StdOut, updaterTask.StdErr); if (updaterTask.Exception != null) { sb.AppendFormat("\tException: {0}{1}", updaterTask.Exception, Environment.NewLine); } } ReportIgnoredAssembliesDueToPreviousErrors(sb, allTasks.Except(tasksWithErrors)); APIUpdaterLogger.WriteErrorToConsole(sb.ToString()); return(true); }
private static bool HandleCheckAssemblyPublishUpdaterConfigErrors(AssemblyUpdaterCheckAssemblyPublishConfigsTask[] nonTimedOutTasks) { var withErrors = nonTimedOutTasks.Where(t => APIUpdaterAssemblyHelper.IsError(t.Result) || t.Exception != null); if (!withErrors.Any()) { return(false); } var sb = new StringBuilder(L10n.Tr("Failed to check following assemblies for updater configurations:\r\n")); foreach (var failledAssemblyInfo in withErrors) { sb.AppendFormat(L10n.Tr("{0} (ret = {1}):\r\n{2}\r\n{3}\r\n"), failledAssemblyInfo.Candidate.Path, failledAssemblyInfo.Result, failledAssemblyInfo.StdOut, failledAssemblyInfo.StdErr); } sb.Append("\r\n--------------"); APIUpdaterLogger.WriteErrorToConsole(sb.ToString()); return(true); }
private static bool HandleAssemblyUpdaterErrors(IEnumerable <AssemblyUpdaterUpdateTask> allTasks) { var tasksWithErrors = allTasks.Where(t => APIUpdaterAssemblyHelper.IsError(t.Result) || APIUpdaterAssemblyHelper.IsUnknown(t.Result) || t.Exception != null); if (!tasksWithErrors.Any()) { return(false); } var sb = new StringBuilder(L10n.Tr("Unable to update following assemblies:")); foreach (var updaterTask in tasksWithErrors) { sb.Append(FormatErrorFromTask(updaterTask)); } ReportIgnoredAssembliesDueToPreviousErrors(sb, allTasks.Except(tasksWithErrors)); APIUpdaterLogger.WriteErrorToConsole(sb.ToString()); return(true); }