Error handling in most languages (e.g. Java and JavaScript) is horrible, with errors of any arbitrary type potentially occurring at any arbitrary moment.
If you want errors to be predictable enough that applications can make sensible error messages out of them, you want those applications to be written in something like #Rust.
@argv_minus_one I've never had an issue with it writing in C for 25 years. Likewise Java for slightly less time.
You do something. Check for the error condition, and if you have one you can exit with an error message saying as such. Just "an error occured" is lazy programming.
@argv_minus_one "error trying to do $thing."
Still more useful than just "unknown error"