-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add a path for checking ZoneInformation without throwing an exception #8025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| string errorMessage = StringUtil.Format( | ||
| FileSystemProviderStrings.AlternateDataStreamNotFound, streamName, path); | ||
| throw new FileNotFoundException(errorMessage, resultPath); | ||
| throw new FileNotFoundException(errorMessage, $"{path}:{streamName.Trim()}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need Trim() for streamName in the internal methods? We do not this for path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure - I just opted to not change any functionality. Small cost on the error path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote to remove - I believe consumer should take care.
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
TravisEz13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Summary
In an effort to reduce the number of exceptions we throw as standard flowcontrol, this PR adds
as a non-throwing alternative to
CreateFileStream.This makes the code slightly faster and debugging slightly less annoying.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests