From d405c56678a3b50f64e9e6fe1c380d321c6b61f3 Mon Sep 17 00:00:00 2001 From: vitek-karas Date: Tue, 17 Jul 2018 05:12:15 -0700 Subject: [PATCH] Correctly detect missing components --- src/gutenapp/gutenapp/AssemblyFileResolver.cs | 5 ++++- src/gutenapp/gutenapp/Program.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gutenapp/gutenapp/AssemblyFileResolver.cs b/src/gutenapp/gutenapp/AssemblyFileResolver.cs index e3db2c7..92226fe 100644 --- a/src/gutenapp/gutenapp/AssemblyFileResolver.cs +++ b/src/gutenapp/gutenapp/AssemblyFileResolver.cs @@ -205,7 +205,10 @@ public class AssemblyFileResolver foreach (var dir in dirs) { var (libraryFound, libraryPath) = ProbeDirectoryForLibrary(dir, library); - candidateLibs.Add(libraryPath); + if (libraryFound) + { + candidateLibs.Add(libraryPath); + } } } diff --git a/src/gutenapp/gutenapp/Program.cs b/src/gutenapp/gutenapp/Program.cs index e66da97..d7d6193 100644 --- a/src/gutenapp/gutenapp/Program.cs +++ b/src/gutenapp/gutenapp/Program.cs @@ -30,7 +30,7 @@ static async Task Main(string[] args) if (!wordcountFound || !mostcommonwordsFound) { - throw new Exception(); + throw new ApplicationException("Can't find 'wordcount' or 'mostcommonwords' components."); } var (wordcountContext, wordCountAsm) = ComponentContext.CreateContext(wordCountPath);