Skip to content

GetInsertionIndex should include the entry's name when it throws an InvalidOperationException#796

Merged
wilbaker merged 1 commit into
microsoft:masterfrom
wilbaker:log_non_unique_entry_name
Feb 19, 2019
Merged

GetInsertionIndex should include the entry's name when it throws an InvalidOperationException#796
wilbaker merged 1 commit into
microsoft:masterfrom
wilbaker:log_non_unique_entry_name

Conversation

@wilbaker
Copy link
Copy Markdown
Member

While on support I found that this error did not include any information about the entry that VFS4G determined was non-unique:

[2/15/2019 12:13:36 PM] Error {"Area":"GitIndexProjection",
"Exception":"System.InvalidOperationException: All entries should be unique
   at GVFS.Virtualization.Projection.GitIndexProjection.SortedFolderEntries.GetInsertionIndex(LazyUTF8String name)
   at GVFS.Virtualization.Projection.GitIndexProjection.AddItemFromIndexEntry(GitIndexEntry indexEntry)
   at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.AddToProjection(GitIndexEntry data)
   at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.ParseIndex(ITracer tracer, Stream indexStream, Func`2 entryAction)
   at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.RebuildProjection(ITracer tracer, Stream indexStream)
   at GVFS.Virtualization.Projection.GitIndexProjection.BuildProjection()
   at GVFS.Virtualization.Projection.GitIndexProjection.ParseIndexThreadMain()",
"ErrorMessage":"ParseIndexThreadMain caught unhandled exception, exiting process"}

With the changes in this PR, the item's name will be included in the exception message:

"Exception":"System.InvalidOperationException: All entries should be unique, non-unique entry: Params.cpp

Although the full path is not included, having the file name helps when tracking down which entries in the index might be causing an issue.

@wilbaker wilbaker self-assigned this Feb 16, 2019
@wilbaker wilbaker added platform: macOS platform: windows affects: live-site Improving our ability to diagnose and fix the product labels Feb 16, 2019
Copy link
Copy Markdown
Member

@jrbriggs jrbriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@jrbriggs jrbriggs added this to the M149 milestone Feb 16, 2019
@wilbaker wilbaker merged commit 69d9275 into microsoft:master Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects: live-site Improving our ability to diagnose and fix the product platform: macOS platform: windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants