Skip to content

Commit 3f2060e

Browse files
authored
DirectoryWatcher: Small adjustments (#1112)
- Have the handler throw - Log the failure at error level
1 parent 0a7fb07 commit 3f2060e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/Helpers/APIServer/DirectoryWatcher.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public class DirectoryWatcher {
5959

6060
do {
6161
let files = try FileManager.default.contentsOfDirectory(atPath: directoryURL.path)
62-
try? handler(files.map { directoryURL.appending(path: $0) })
62+
try handler(files.map { directoryURL.appending(path: $0) })
6363
} catch {
64-
self.log.info("failed to run handler for \(directoryURL.path)")
64+
self.log.error("failed to run DirectoryWatcher handler", metadata: ["error": "\(error)", "path": "\(directoryURL.path)"])
6565
}
6666
}
6767

0 commit comments

Comments
 (0)