From 39518ed1c1e5384d21b094c4d0c823443f3baab6 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Sat, 1 Jul 2017 11:59:02 -0500 Subject: [PATCH] Make "No such file or directory" errors more descriptive Previously, "No such file or directory" errors would point to this line in this file, i.e. `fileError(2, "No such file or directory /Users/[redacted]/Desktop/Programming/Swift/Perfect/[redacted]/Core/.build/checkouts/PerfectLib.git-3712999737848873669/Sources/PerfectLib/File.swift open(_:permissions:) 245")` This change will replace that error with: `fileError(2, "No such file or directory /Users/[redacted]/Desktop/Programming/Swift/Perfect/[redacted]/log/log.log open(_:permissions:) 244")` --- Sources/PerfectLib/File.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/PerfectLib/File.swift b/Sources/PerfectLib/File.swift index 309a0c3c..555698a2 100644 --- a/Sources/PerfectLib/File.swift +++ b/Sources/PerfectLib/File.swift @@ -241,7 +241,7 @@ public extension File { let openFd = Darwin.open(internalPath, CInt(mode.toMode), permissions.rawValue) #endif guard openFd != -1 else { - try ThrowFileError() + try ThrowFileError(file: internalPath) } fd = Int(openFd) }