Skip to content

Commit

Permalink
Merge pull request #217: RepoRegistry: Properly log error from TryGet…
Browse files Browse the repository at this point in the history
…NormalizedPath

While investigating a user issue with auto mount registration, I noticed that their logs contained a failure from TryGetNormalizedPath, but did not log the error message. Add that message to the logs so we can properly diagnose the issue.

Further, the 'normalizedEnlistmentRootPath' parameter becomes null, so do not add it to the dictionary in that case. Instead, it should be logged by the RelatedWarning.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
  • Loading branch information
derrickstolee authored Aug 28, 2018
2 parents 607a4e2 + 9eecaf5 commit 4fec348
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion GVFS/GVFS.Service/RepoRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,15 @@ public Dictionary<string, RepoRegistration> ReadRegistry()
{
EventMetadata metadata = new EventMetadata();
metadata.Add("registration.EnlistmentRoot", registration.EnlistmentRoot);
metadata.Add("NormalizedEnlistmentRootPath", normalizedEnlistmentRootPath);
metadata.Add("ErrorMessage", errorMessage);
this.tracer.RelatedWarning(metadata, $"{nameof(ReadRegistry)}: Failed to get normalized path name for registed enlistment root");
}

allRepos[normalizedEnlistmentRootPath] = registration;
if (normalizedEnlistmentRootPath != null)
{
allRepos[normalizedEnlistmentRootPath] = registration;
}
}
catch (Exception e)
{
Expand Down

0 comments on commit 4fec348

Please sign in to comment.