mirror of
https://github.com/apple/container.git
synced 2026-09-22 23:55:34 +00:00
DirectoryWatcher: Small adjustments (#1112)
- Have the handler throw - Log the failure at error level
This commit is contained in:
@@ -59,9 +59,9 @@ public class DirectoryWatcher {
|
||||
|
||||
do {
|
||||
let files = try FileManager.default.contentsOfDirectory(atPath: directoryURL.path)
|
||||
try? handler(files.map { directoryURL.appending(path: $0) })
|
||||
try handler(files.map { directoryURL.appending(path: $0) })
|
||||
} catch {
|
||||
self.log.info("failed to run handler for \(directoryURL.path)")
|
||||
self.log.error("failed to run DirectoryWatcher handler", metadata: ["error": "\(error)", "path": "\(directoryURL.path)"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user