From e68011d701b5643bd69746eb2217ed55aee69f9b Mon Sep 17 00:00:00 2001 From: Rob Pearson Date: Mon, 1 Feb 2016 20:38:54 +1000 Subject: [PATCH] Validation errors are now raised as exceptions so return a non-zero error code. --- source/OctopusTools/Importers/ProjectImporter.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/OctopusTools/Importers/ProjectImporter.cs b/source/OctopusTools/Importers/ProjectImporter.cs index c6c4e8cc0..497e8d352 100644 --- a/source/OctopusTools/Importers/ProjectImporter.cs +++ b/source/OctopusTools/Importers/ProjectImporter.cs @@ -115,11 +115,9 @@ protected override bool Validate(Dictionary paramDictionary) if (validatedImportSettings.HasErrors) { - Log.Error("The following issues were found with the provided import file:"); - foreach (var error in validatedImportSettings.ErrorList) - { - Log.ErrorFormat(" {0}", error); - } + var errorMessagesCsvString = string.Join(Environment.NewLine, validatedImportSettings.ErrorList); + var errorMessage = string.Format($"The following issues were found with the provided import file: {Environment.NewLine}{errorMessagesCsvString}"); + throw new CommandException(errorMessage); } else {