Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on reading host data are promoted to warning level #3655

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ private void WriteExceptionDetails<TState>(TextWriter textWriter, in LogEntry<TS
{
if (logEntry.Exception != null)
{
textWriter.WriteLine($"Details: {logEntry.Exception}");
if (logEntry.LogLevel == LogLevel.Debug || logEntry.LogLevel == LogLevel.Trace)
{
textWriter.WriteLine($"Details: {logEntry.Exception}");
}
else
{
textWriter.WriteLine($"Details: {logEntry.Exception.Message}");
}
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/Microsoft.TemplateEngine.Cli/HostSpecificDataLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ private HostSpecificTemplateData ReadHostSpecificTemplateDataUncached(ITemplateI
}
catch (Exception e)
{
_engineEnvironment.Host.Logger.LogDebug(e, $"Failed to load host data for template {templateInfo.ShortNameList?[0] ?? templateInfo.Name}: the json data in {nameof(ITemplateInfoHostJsonCache.HostData)} is incorrect.");
return HostSpecificTemplateData.Default;
_engineEnvironment.Host.Logger.LogWarning(
e,
LocalizableStrings.HostSpecificDataLoader_Warning_FailedToRead,
templateInfo.ShortNameList?[0] ?? templateInfo.Name);
}
}

Expand All @@ -70,8 +72,11 @@ private HostSpecificTemplateData ReadHostSpecificTemplateDataUncached(ITemplateI
}
catch (Exception e)
{
_engineEnvironment.Host.Logger.LogDebug(e, $"Failed to load host data for template {templateInfo.ShortNameList?[0] ?? templateInfo.Name}, file: " +
$"{file?.GetDisplayPath() ?? templateInfo.MountPointUri + templateInfo.HostConfigPlace}");
_engineEnvironment.Host.Logger.LogWarning(
e,
LocalizableStrings.HostSpecificDataLoader_Warning_FailedToReadFromFile,
templateInfo.ShortNameList?[0] ?? templateInfo.Name,
file?.GetDisplayPath() ?? templateInfo.MountPointUri + templateInfo.HostConfigPlace);
}
finally
{
Expand Down
18 changes: 18 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -761,4 +761,12 @@ The supported columns are: language, tags, author, type.</value>
<value>Invalid command syntax: use '{0}' instead.</value>
<comment>{0} - command syntax, example: dotnet new [PARTIAL_NAME] --list [FILTER_OPTIONS].</comment>
</data>
</root>
<data name="HostSpecificDataLoader_Warning_FailedToRead" xml:space="preserve">
<value>Failed to load dotnet CLI host data for template {0} from cache.</value>
<comment>{0} - template short name</comment>
</data>
<data name="HostSpecificDataLoader_Warning_FailedToReadFromFile" xml:space="preserve">
<value>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</value>
<comment>{0} - template short name, {1} - file path to host data.</comment>
</data>
</root>
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Pokud si chcete zobrazit všechny aliasy, spusťte bez argumentů příkaz dotne
<target state="translated">Příklady:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Nainstaluje zdroj nebo balíček šablon.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Führen Sie "dotnet {1}--show-aliases" ohne Argumente aus, um alle Aliase anzuze
<target state="translated">Beispiele:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Installiert ein Quell- oder Vorlagenpaket.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Ejecute "dotnet {1} --show-aliases" sin argumentos para mostrar todos los alias.
<target state="translated">Ejemplos:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Instala un paquete de origen o de plantilla.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Exécutez « dotnet {1} --show-aliases » sans arguments pour afficher tous le
<target state="translated">Exemples :</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Installe une source ou un package de modèle.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Eseguire 'dotnet {1}--show-alias ' senza argomenti per mostrare tutti gli alias.
<target state="translated">Esempi:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Installa un pacchetto di origine o di modello.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases.</source>
<target state="translated">例:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">ソースまたはテンプレート パッケージをインストールします。</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases.</source>
<target state="translated">예:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">소스 또는 템플릿 패키지를 설치합니다.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Uruchom polecenie "dotnet {1}--show-aliases" bez argumentów, aby wyświetlić w
<target state="translated">Przykłady:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Instaluje źródło lub pakiet szablonów.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Execute 'dotnet {1} --mostrar- aliases' sem nenhum args para mostrar todos os al
<target state="translated">Exemplos:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Instala um pacote de origem ou de modelo.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases.</source>
<target state="translated">Примеры:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Устанавливает источник или пакет шаблона.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Tüm diğer adları göstermek için 'dotnet {1} --show-aliases' komutunu bağı
<target state="translated">Örnekler:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">Bir kaynak veya şablon paketi yükler.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases.</source>
<target state="translated">示例: </target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">安装源或模板包。</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases.</source>
<target state="translated">範例:</target>
<note />
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToRead">
<source>Failed to load dotnet CLI host data for template {0} from cache.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from cache.</target>
<note>{0} - template short name</note>
</trans-unit>
<trans-unit id="HostSpecificDataLoader_Warning_FailedToReadFromFile">
<source>Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</source>
<target state="new">Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.</target>
<note>{0} - template short name, {1} - file path to host data.</note>
</trans-unit>
<trans-unit id="InstallHelp">
<source>Installs a source or a template package.</source>
<target state="translated">安裝來源或範本套件。</target>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/Microsoft.TemplateEngine.Edge/LocalizableStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ Details: {0}.</value>
<data name="TemplateCreator_TemplateCreationResult_Error_DestructiveChanges" xml:space="preserve">
<value>Destructive changes detected.</value>
</data>
<data name="TemplateInfo_Warning_FailedToReadHostData" xml:space="preserve">
<value>Failed to load host data in {0} at {1}.</value>
<comment>{0} - path to template location, {1} relative path inside template location.</comment>
</data>
<data name="TemplatePackageManager_Error_FailedToScan" xml:space="preserve">
<value>Failed to scan {0}.
Details: {1}</value>
Expand Down
Loading