diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2023-12-09 16:45:31 -0700 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2023-12-09 16:45:31 -0700 |
commit | 0d6c7aa962e2fb14f29d7ad0c9fc197aedf1d372 (patch) | |
tree | ab89319020bd17a02133050104e8ce4b105b11a3 /Sources/gopherHandler.swift | |
parent | bbf13e5424ccbf2da632ef3427217c7779285a9b (diff) |
add descriptive error
Diffstat (limited to 'Sources/gopherHandler.swift')
-rw-r--r-- | Sources/gopherHandler.swift | 6 |
1 files 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") } |