Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
danmoseley committed Jun 14, 2022
1 parent 98d4b4b commit ed2bc2b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/libraries/Common/src/Interop/Unix/Interop.IOErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? pa
switch (errorInfo.Error)
{
case Error.ENOENT:
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
if (isDirectory)
{
return !string.IsNullOrEmpty(path) ?
Expand All @@ -133,34 +133,34 @@ internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? pa
case Error.EACCES:
case Error.EBADF:
case Error.EPERM:
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
Exception inner = GetIOException(errorInfo);
return !string.IsNullOrEmpty(path) ?
new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, path), inner) :
new UnauthorizedAccessException(SR.UnauthorizedAccess_IODenied_NoPathName, inner);

case Error.ENAMETOOLONG:
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
return !string.IsNullOrEmpty(path) ?
new PathTooLongException(SR.Format(SR.IO_PathTooLong_Path, path)) :
new PathTooLongException(SR.IO_PathTooLong);

case Error.EWOULDBLOCK:
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
return !string.IsNullOrEmpty(path) ?
new IOException(SR.Format(SR.IO_SharingViolation_File, path), errorInfo.RawErrno) :
new IOException(SR.IO_SharingViolation_NoFileName, errorInfo.RawErrno);

case Error.ECANCELED:
if (!string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (!string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
return new OperationCanceledException();

case Error.EFBIG:
if (!string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (!string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
return new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_FileLengthTooBig);

case Error.EEXIST:
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.txt"), Environment.StackTrace);
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.txt"), Environment.StackTrace);
if (!string.IsNullOrEmpty(path))
{
return new IOException(SR.Format(SR.IO_FileExists_Name, path), errorInfo.RawErrno);
Expand All @@ -174,7 +174,7 @@ internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? pa

internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
{
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorCode}.{rand}.GetIOException.txt"), Environment.StackTrace);
if (string.IsNullOrEmpty(path)) File.AppendAllText(Path.Join(Path.GetTempPath(), $"{errorInfo.Error}.{rand}.GetIOException.txt"), Environment.StackTrace);
string msg = errorInfo.GetErrorMessage();
return new IOException(
string.IsNullOrEmpty(path) ? msg : $"{msg} : '{path}'", errorInfo.RawErrno);
Expand Down

0 comments on commit ed2bc2b

Please sign in to comment.