Earlier quoted context omitted.
> What does it have to do with errors? The fact that the former scenario is much more likelier to happen in golang due to its error handling. The former can be caught using unit tests, and should stick out more in languages like Java with scoped try-with-resources blocks that limit the scope of lifetimed variables (another bad design in golang where defers are function scope, not local scope limited, introducing unne…
> At the same time, you don't want to be writing unit tests for every simple scenario. Yup, exactly. In a perfect world you would, but the world ain't perfect. Sooner or later you're accidentally deleting the wrong thing because you didn't test it/didn't test it correctly. And for what reason? A language can guard against that kind of mistake quite well. So, that still leaves us wondering why you don't find it advant…
It seems Rust has the same issue by the way: https://docs.rs/error-chain/latest/error_chain/
> If the RUST_BACKTRACE environment variable is set to anything but 0, the earliest non-foreign error to be generated creates a single backtrace
If my understanding is correct, it means that you won't get stack traces for any external libraries or code that does not use this library.
Because Exceptions in Java/C#/etc. are special, you will always have stack traces regardless of which code you're calling.