So the full message would be like "Cannot add item X to cart Y: Error connecting to warehouse Z: Error establishing TLS connection to example.com 127.0.1.1: PKIX failed".
I.E. ERROR: TLS handshake failed: <DOMAIN> certificate chain unverified
Just like your example: single line, to the point and loggable. e.g.
writing foo.zip: performing http request (bar.com): tls: handshake: expired certificate (1970-01-01)
Exceptions with stack traces are so much more work for the reader. The effort of distilling what's going on is pushed to me at "runtime". Whereas in Go, this effort happens at compile time. The programmer curates the relevant context.For what it’s worth, the rise of helpful error messages seems to be a relatively new phenomenon the last few years.
The difference really becomes apparent when trying to debug a customer's problem at 3am (IME).
There is no ecosystem I would choose over Java when it comes to observability and it's not even close.
Good luck finding your segfault, oom, race condition or just simply lazy logging culture bug with a C/go codebase at 3am.
I will happily see my proper stack trace, heap dump, or connect directly to prod with a debugger with basically no performance penalty.
And if you're not catching N levels up but catching at each level, then you are emulating error values but with try/catch blocks.