Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Thoughts on Go vs. Rust vs. Zig. Parent comment
do { let file = try FileManager.create(…) } catch { logger.error("Failed creating file", metadata: ["error": "\(error)"]) }
You can opt-out of the error handling, but it’s frowned upon, and explicit:
let file = try? FileManager.create(…)
let file = try! FileManager.create(…)
There are no comments on this comment yet.
You can opt-out of the error handling, but it’s frowned upon, and explicit:
or The former returning an optional file if there is an error, and the latter crashing in case of an error.