Skip to content

Commit fdb5900

Browse files
authored
Merge pull request #200 from neonichu/improve-tmpdir-error
Include the directory we tried in tmpDir error
2 parents 3eba1fa + 19bfbdd commit fdb5900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/TSCBasic/TemporaryFile.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum TempFileError: Error {
2525
case other(Int32)
2626

2727
/// Couldn't find a temporary directory.
28-
case couldNotFindTmpDir
28+
case couldNotFindTmpDir(String)
2929
}
3030

3131
extension TempFileError: CustomNSError {
@@ -55,7 +55,7 @@ private extension TempFileError {
5555
public func determineTempDirectory(_ dir: AbsolutePath? = nil) throws -> AbsolutePath {
5656
let tmpDir = dir ?? cachedTempDirectory
5757
guard localFileSystem.isDirectory(tmpDir) else {
58-
throw TempFileError.couldNotFindTmpDir
58+
throw TempFileError.couldNotFindTmpDir(tmpDir.pathString)
5959
}
6060
return tmpDir
6161
}

0 commit comments

Comments
 (0)