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

Improve rename error #2731

Merged
merged 1 commit into from
May 29, 2024
Merged

Improve rename error #2731

merged 1 commit into from
May 29, 2024

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented May 29, 2024

Motivation:

The name of the syscall used in errors for all rename calls is "rename". However, this isn't always correct, in some cases "renamex_np" is used, and in others "renameat2" is used.

Modifications:

  • Allow the name of the syscall to be provided to the rename error
  • Use the correct syscall name

Result:

Better errors

Motivation:

The name of the syscall used in errors for all rename calls is "rename".
However, this isn't always correct, in some cases "renamex_np" is used,
and in others "renameat2" is used.

Modifications:

- Allow the name of the syscall to be provided to the rename error
- Use the correct syscall name

Result:

Better errors
@glbrntt glbrntt added the semver/patch No public API change. label May 29, 2024
@glbrntt glbrntt requested a review from gjcairo May 29, 2024 12:31
@glbrntt
Copy link
Contributor Author

glbrntt commented May 29, 2024

The breaking changes are okay as they are all SPI:

13:34:58 4 breaking changes detected in _NIOFileSystem:
13:34:58   💔 API breakage: func FileSystemError.rename(errno:oldName:newName:location:) has parameter 0 type change from SystemPackage.Errno to Swift.String
13:34:58   💔 API breakage: func FileSystemError.rename(errno:oldName:newName:location:) has parameter 1 type change from SystemPackage.FilePath to SystemPackage.Errno
13:34:58   💔 API breakage: func FileSystemError.rename(errno:oldName:newName:location:) has parameter 3 type change from _NIOFileSystem.FileSystemError.SourceLocation to SystemPackage.FilePath
13:34:58   💔 API breakage: func FileSystemError.rename(errno:oldName:newName:location:) has been renamed to func rename(_:errno:oldName:newName:location:)

@glbrntt glbrntt enabled auto-merge (squash) May 29, 2024 13:09
@glbrntt glbrntt disabled auto-merge May 29, 2024 13:17
@glbrntt glbrntt merged commit 9f63b12 into apple:main May 29, 2024
7 of 9 checks passed
@glbrntt glbrntt deleted the improve-error branch May 29, 2024 13:17
chkp-aviads added a commit to chkp-aviads/swift-nio that referenced this pull request Jul 21, 2024
* commit 'fc79798d5a150d61361a27ce0c51169b889e23de':
  NIOSendableBox: allow off-loop initialisation iff Value is Sendable (apple#2753)
  Throw an appropriate error from the writer when the channel closed (apple#2744)
  put snippet code inside @available function (apple#2750)
  fix link to NIOFileSystem from NIO index page (apple#2747)
  convert the NIOFileSystem example code to a Snippet (apple#2746)
  Silence warning about missing include in macOS builds (apple#2741)
  Correctly mark 304 as not having a response body (apple#2737)
  Update availability guard (apple#2739)
  Add API for setting last accessed and last modified file times (apple#2735)
  Add a fallback path if renameat2 fails (apple#2733)
  Release file handles back to caller on failure to take ownership (apple#2715)
  Add a version of 'write' for 'ByteBuffer' (apple#2730)
  Imrprove rename error (apple#2731)
  Remove storage indirection for FileSystemError (apple#2726)
  testSimpleMPTCP should not fail for ENOPROTOOPT (apple#2725)
  Fix race in TCPThroughputBenchmark (apple#2724)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants