Content Deep Dive
Making Go errors play nice with Sentry
Blog post from Incident.io
Post Details
Company
Date Published
Author
Lawrence Jones
Word Count
1,417
Language
English
Hacker News Points
-
Source URL
Summary
The text discusses how to make Go errors work well with Sentry, an error tracking tool. It explains that standard Go errors don't have stacktraces, which makes it hard for tools like Sentry to provide much value. To address this issue, the author suggests using pkg/errors, a library that implements StackTracer errors and is compatible with Sentry. The text also covers how to wrap errors to ensure they include stacktraces and how to de-duplicate stacktraces when wrapping multiple times. Finally, it mentions creating their own version of pkg/errors to better control error production and improve compatibility with tools like Sentry.