Skip to content

Commit

Permalink
Handle template scan error for a single folder
Browse files Browse the repository at this point in the history
If an error occurs due to an invalid template.json file when
scanning a folder this exception is caught and logged and then the
next folder is tried. Previously an exception would stop the
processing of all the  other folders so valid templates would not
be available.
  • Loading branch information
mrward committed Jun 2, 2018
1 parent 0b15e10 commit 38e8f64
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ public void LoadTemplates ()

foreach (string folder in TemplatingServices.Options.TemplateFolders) {
if (Directory.Exists (folder)) {
settingsLoader.UserTemplateCache.Scan (folder);
try {
settingsLoader.UserTemplateCache.Scan (folder);
} catch (Exception ex) {
string message = string.Format ("Unable to load templates from folder '{0}.", folder);
TemplatingServices.LogError (message, ex);
}
}
}

Expand Down

0 comments on commit 38e8f64

Please sign in to comment.