Re stack traces, they're fine I guess, but I prefer a well-crafted error message to 200 lines of irrelevant file locations/functions.
In practice it's impossible to exercise all the inputs your programs may get, and then they crash in production when users do things you don't expect.
Something had happened during the processing of this web request? Catch the exception and convert it to an appropriate status code.
You should only ever let exceptions fall through ”main” when the problem is really not something you can manage to handle.
In practice often people let the exception eater in main handle it, and it either logs somewhere nobody looks or returns this sort of generic error and exits:
https://www.google.com/search?q=Microsoft+Word+has+encounter...
An error being returned doesn't always mean there's a bug.
> Go is like shell in that it keeps going even if there's an error.
With both Go and shell scripts it's up to you if you want the program to keep going when there's an error.
The bug is not the error, the bug is the unhandled error.
This is so backwards. First, I want my program to immediately crash if I have a bug. Go is like shell in that it keeps going even if there's an error. Second, I'm used to getting stack traces, Go is the language that will give "no explanation" by comparison if there's a failure.