miniblog.

← Back to all posts
327
There are *so many* ways that reading a text file can fail. Maybe it doesn't exist, it's a broken symlink, it's actually a directory, it's not the encoding you expected, or perhaps you just don't have the correct permissions. Reporting good errors is surprisingly labour intensive.

7 Comments

@wilfredh GNOME: "Oh no! Something went wrong." @gnome
@wilfredh AI can lighten the load
@wilfredh Random idea: worth to link to a webpage with a list of possible cases? And the webpage is deep linkable with OS, failure case, etc.
@wilfredh The easiest time I've had writing great error messages even in rapidly developed prototypes is when I'm using the anyhow crate in Rust. You can add "context" to any fallible action, so (almost without trying) you get error messages that say what went wrong (e.g., no such file or directory) and also when (e.g., trying to open user preferences file while starting the foo engine).
@wilfredh ... maybe an interrupt came in during the read...
@flowchainsenseisocial @wilfredh ooh, yeah! Like it just did with our tariff calculation.
Or it's a block device and you get an IO error! Or it's on fuse and you get something even weirder! Or it's a network device and it times out!