public static void WriteOutput(OctoClientErrors errors) { foreach (var err in errors.ErrorMessages) { Console.WriteLine($"::error:: {err}"); } }
public static void ParseException(this OctoClientErrors errors, Exception ex) { var exMsg = ex.Message; var lines = exMsg.Split(Environment.NewLine).ToList(); var output = lines.Where(x => !string.IsNullOrWhiteSpace(x)).ToList(); errors.ErrorMessages.AddRange(output); return; }
public OctoClientErrors ValidateCommonInputs() { var errors = new OctoClientErrors(); if (string.IsNullOrWhiteSpace(OctopusURL)) { errors.ErrorCount++; errors.ErrorMessages.Add("Octopus URL is missing and required"); } if (string.IsNullOrWhiteSpace(OctopusApiKey)) { errors.ErrorCount++; errors.ErrorMessages.Add("API Key is missing and required"); } if (string.IsNullOrWhiteSpace(ProjectName)) { errors.ErrorCount++; errors.ErrorMessages.Add("ProjectName is missing and required"); } return(errors); }