Uh oh!
There was an error while loading. Please reload this page.
throw exception when creating an entry name that already exists in ZipArchive - #60973
Conversation
ghost
commented
Oct 28, 2021
Tagging subscribers to this area: @dotnet/area-system-io-compression |
| <value>Zip 64 End of Central Directory Record not where indicated.</value> | ||
| </data> | ||
| <data name="EntryNameAlreadyExists" xml:space="preserve"> | ||
| <value>The entry name already exists in the archive.</value> |
There was a problem hiding this comment.
is the entryname a reasonable length? if so I suggest to include in the message ie
| <value>The entry name already exists in the archive.</value> | |
| <value>The entry name '{0}' already exists in the archive.</value> |
whenever an exception refers to a named thing (like a path, etc) it can be helpful to include what the thing is.
There was a problem hiding this comment.
if you did this, you'd use AssertExtensions.ThrowsContains to verify it's present.
There was a problem hiding this comment.
I think the entry name would have reasonable length because it's just a file name
carlossanlop
left a comment
There was a problem hiding this comment.
Thanks for your contribution, @pedrobsaila , and thank you for your patience.
I left some suggestions for you to consider.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…sue with globalization
carlossanlop
left a comment
There was a problem hiding this comment.
Looks great, @pedrobsaila. Thanks for your contribution!
| if (_entriesDictionary.ContainsKey(entryName)) | ||
| { | ||
| throw new InvalidOperationException(string.Format(SR.EntryNameAlreadyExists, entryName)); | ||
| } |
There was a problem hiding this comment.
I'm working on getting various MAUI workloads running on .NET 7. One of our tests hit an issue due to this change.
An MSBuild task inside a NuGet package has the following call:
Previously the code was creating a new entry then removing the old one afterward. (Code is old, it may indeed be incorrect)
Is the new exception intentional? Is it something that needs to be on a "breaking changes" list somewhere?
There was a problem hiding this comment.
I filed an issue; it seems I can reproduce in a smaller example: #68734
Fixes#51051