Skip to content

Commit e87f094

Browse files
authored
(166708410) _amkrtemp error string includes "Optional" (#1654)
1 parent 19e3979 commit e87f094

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/FoundationEssentials/Data/Data+Writing.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ private func createTemporaryFile(at destinationPath: String, inPath: PathOrURL,
173173
if let sandboxResult {
174174
return sandboxResult
175175
}
176+
177+
// If we have no result and also no errno, just fail immediately because we failed to produce a file system representation for the path
178+
guard let amkrErrno else {
179+
throw CocoaError.errorWithFilePath(.fileReadInvalidFileName, inPath.path)
180+
}
181+
176182
// If _amkrtemp failed with EEXIST, just retry
177183
if amkrErrno == EEXIST {
178184
continue

0 commit comments

Comments
 (0)