From 9eecaf5dff053b1bc1f29a3066cb706894079b24 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Tue, 28 Aug 2018 09:51:32 -0400 Subject: [PATCH] RepoRegistry: Properly log error from TryGetNormalizedPath 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 --- GVFS/GVFS.Service/RepoRegistry.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GVFS/GVFS.Service/RepoRegistry.cs b/GVFS/GVFS.Service/RepoRegistry.cs index a4a7345e6a..646691440a 100644 --- a/GVFS/GVFS.Service/RepoRegistry.cs +++ b/GVFS/GVFS.Service/RepoRegistry.cs @@ -248,10 +248,15 @@ public Dictionary 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) {