Skip to content

Commit 1d57f6a

Browse files
committed
[docs] Mention obj-c exceptions and swift 5.2 issues in the docs for TarReader/Writer
1 parent 552cb31 commit 1d57f6a

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Sources/TAR/TarReader.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ import BitByteData
2525
Note that closing the `FileHandle` remains the responsibility of the caller.
2626

2727
- Important: Due to the API availability limitations of Foundation's `FileHandle`, on certain platforms errors in
28-
`FileHandle` operations may result in unrecoverable runtime failures. As such, it is not recommended to use `TarWriter`
29-
on those platforms. The following platforms are _unaffected_ by this issue: macOS 10.15.4+, iOS 13.4+, watchOS 6.2+,
30-
tvOS 13.4+.
28+
`FileHandle` operations may result in unrecoverable runtime failures due to unhandled Objective-C exceptions (which are
29+
impossible to correctly handle in Swift code). As such, it is not recommended to use `TarReader` on those platforms.
30+
The following platforms are _unaffected_ by this issue: macOS 10.15.4+, iOS 13.4+, watchOS 6.2+, tvOS 13.4+, and any
31+
other platforms without Objective-C runtime (however, it still can be encountered if using the Swift version older than
32+
5.2).
3133
*/
3234
public struct TarReader {
3335

Sources/TAR/TarWriter.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ import Foundation
2828
the `FileHandle` remains the responsibility of the caller.
2929

3030
- Important: Due to the API availability limitations of Foundation's `FileHandle`, on certain platforms errors in
31-
`FileHandle` operations may result in unrecoverable runtime failures. As such, it is not recommended to use `TarWriter`
32-
on those platforms. The following platforms are _unaffected_ by this issue: macOS 10.15.4+, iOS 13.4+, watchOS 6.2+,
33-
tvOS 13.4+.
31+
`FileHandle` operations may result in unrecoverable runtime failures due to unhandled Objective-C exceptions (which are
32+
impossible to correctly handle in Swift code). As such, it is not recommended to use `TarWriter` on those platforms.
33+
The following platforms are _unaffected_ by this issue: macOS 10.15.4+, iOS 13.4+, watchOS 6.2+, tvOS 13.4+, and any
34+
other platforms without Objective-C runtime (however, it still can be encountered if using the Swift version older than
35+
5.2).
3436
*/
3537
public struct TarWriter {
3638

0 commit comments

Comments
 (0)