From 0d6c7aa962e2fb14f29d7ad0c9fc197aedf1d372 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sat, 9 Dec 2023 16:45:31 -0700 Subject: add descriptive error --- Sources/gopherHandler.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/gopherHandler.swift b/Sources/gopherHandler.swift index 81a65e2..1c40091 100644 --- a/Sources/gopherHandler.swift +++ b/Sources/gopherHandler.swift @@ -78,7 +78,7 @@ final class GopherHandler: ChannelInboundHandler { return .string(fileContents) } catch { - logger.error("Error reading file: \(path.path)") + logger.error("Error reading file: \(path.path) Error: \(error)") return .string("3Error reading file...\terror.host\t1\r\n") } } else { @@ -87,14 +87,14 @@ final class GopherHandler: ChannelInboundHandler { let fileContents = try Data(contentsOf: path) return .data(fileContents) } catch { - logger.error("Error reading file: \(path.path)") + logger.error("Error reading binary file: \(path.path) Error: \(error)") return .string("3Error reading file...\terror.host\t1\r\n") } } } } else { - logger.error("Error reading file: \(path.path)") + logger.error("Error reading directory: \(path.path) Error: \(error)") return .string("3Error reading file...\terror.host\t1\r\n") } -- cgit v1.2.3