From d4075006c6d0ea07e7fb852019fbbf27b06c8d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20B=C3=BCgling?= Date: Mon, 14 Feb 2022 13:10:05 -0800 Subject: [PATCH] Emit underlying error code when pretty-printing I/O errors (#4121) --- Sources/Workspace/Diagnostics.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Workspace/Diagnostics.swift b/Sources/Workspace/Diagnostics.swift index e0ace1d2d35..3d1bb5eb157 100644 --- a/Sources/Workspace/Diagnostics.swift +++ b/Sources/Workspace/Diagnostics.swift @@ -175,8 +175,8 @@ extension FileSystemError: CustomStringConvertible { switch self.kind { case .invalidAccess: return "invalid access" - case .ioError: - return "encountered I/O error" + case .ioError(let code): + return "encountered I/O error (code: \(code))" case .isDirectory: return "is a directory" case .noEntry: @@ -199,8 +199,8 @@ extension FileSystemError: CustomStringConvertible { switch self.kind { case .invalidAccess: return "invalid access to \(path)" - case .ioError: - return "encountered an I/O error while reading \(path)" + case .ioError(let code): + return "encountered an I/O error (code: \(code)) while reading \(path)" case .isDirectory: return "\(path) is a directory" case .noEntry: