Regarding error handling verbosity, you don't actually have to write
_ = file.write(data) catch |err| { silence_err_somehow(err); ... }.
You can just write _ = file.write(data) catch { ... }.
And the first example of using `catch` in the docs[0] does this. It may be useful to also use the non-error return value of `write` though, because partial writes will return an amount of written bytes less than the amount you asked to write. You need `writeAll` if you want to ignore this concern, and then you don't have to write `_ = ` because the non-error part of the error union is void (so you don't have to use it). Then you get file.writeAll(data) catch { ... }
[0]: https://ziglang.org/documentation/master/#catch