Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Easy. Always wrap. Wrap with what you were doing when the error occurred.

Then we're back to having stack frames for framework and runtime code in our error traces.



In my experience doing this, it does not. The wrapping is all yours to write—frameworks and the standard library don’t use it. Their errors would appear as “leaf” errors decorated by the wrapping you, as a team, have added.


People who write frameworks and even the standard library are still Go programmers. And all major projects have their own internal libraries and frameworks. So any Go programmer has to learn when it's better to wrap an error, and when it's better to bubble it up as-is.

Or perhaps the people who wrote the Go standard library don't follow the ideal Go best practices?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: