Skip to content
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

Include path in IOException in Unix #57389

Merged
merged 1 commit into from
Aug 14, 2021
Merged

Include path in IOException in Unix #57389

merged 1 commit into from
Aug 14, 2021

Conversation

danmoseley
Copy link
Member

In #57221 there is an IOException for a file operation that does not include the path. For most IO related exceptions we include the path, but not in this case.

It turns out we include the path in Windows, but not in non Windows. Copy the same pattern:

default:
return new IOException(
string.IsNullOrEmpty(path) ? GetMessage(errorCode) : $"{GetMessage(errorCode)} : '{path}'",
MakeHRFromErrorCode(errorCode));

@ghost
Copy link

ghost commented Aug 14, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

In #57221 there is an IOException for a file operation that does not include the path. For most IO related exceptions we include the path, but not in this case.

It turns out we include the path in Windows, but not in non Windows. Copy the same pattern:

default:
return new IOException(
string.IsNullOrEmpty(path) ? GetMessage(errorCode) : $"{GetMessage(errorCode)} : '{path}'",
MakeHRFromErrorCode(errorCode));

Author: danmoseley
Assignees: -
Labels:

area-System.IO

Milestone: -

@jozkee jozkee merged commit b3bb5db into dotnet:main Aug 14, 2021
@adamsitnik adamsitnik added this to the 6.0.0 milestone Aug 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants