Skip to content

Commit

Permalink
(chocolateyGH-1581) Log error that caused .registry.bad file
Browse files Browse the repository at this point in the history
Previously, when a .registry file was moved to .registry.bad, there
wasn't an indication of what all might have caused it to be set that
way. Provide some logging based on exactly what causes it, and provide
the entire error output instead of just the message for now.
  • Loading branch information
ferventcoder committed Mar 13, 2019
1 parent b833678 commit 4c4e71c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ focus exclusively in the string values not surrounded by CData. Once
packageInformation.RegistrySnapshot = _registryService.read_from_file(_fileSystem.combine_paths(pkgStorePath, REGISTRY_SNAPSHOT_FILE));
}
}
catch (Exception)
catch (Exception e)
{
if (_config.RegularOutput) this.Log().Warn(@"A .registry file at '{0}'
has errored attempting to read it. This file will be renamed to
'{1}' The error:
{2}
".format_with(_fileSystem.combine_paths(pkgStorePath, REGISTRY_SNAPSHOT_FILE), _fileSystem.combine_paths(pkgStorePath, REGISTRY_SNAPSHOT_BAD_FILE), e.ToString()));

FaultTolerance.try_catch_with_logging_exception(
() =>
{
Expand Down

0 comments on commit 4c4e71c

Please sign in to comment.