Skip to content

Commit d407500

Browse files
authored
Emit underlying error code when pretty-printing I/O errors (#4121)
1 parent 422082c commit d407500

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/Workspace/Diagnostics.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ extension FileSystemError: CustomStringConvertible {
175175
switch self.kind {
176176
case .invalidAccess:
177177
return "invalid access"
178-
case .ioError:
179-
return "encountered I/O error"
178+
case .ioError(let code):
179+
return "encountered I/O error (code: \(code))"
180180
case .isDirectory:
181181
return "is a directory"
182182
case .noEntry:
@@ -199,8 +199,8 @@ extension FileSystemError: CustomStringConvertible {
199199
switch self.kind {
200200
case .invalidAccess:
201201
return "invalid access to \(path)"
202-
case .ioError:
203-
return "encountered an I/O error while reading \(path)"
202+
case .ioError(let code):
203+
return "encountered an I/O error (code: \(code)) while reading \(path)"
204204
case .isDirectory:
205205
return "\(path) is a directory"
206206
case .noEntry:

0 commit comments

Comments
 (0)