Handle errors returned by deferred function calls
Problem to solve
We have a few instances of ignoring an error returned by a deferred function call, for example:
defer conn.Close() // nolint: errcheck
This can result in problems going unnoticed.
Proposal
Use the appropriate combination of
- sentry
- logging
- metrics
on a case-by-case basis. When in doubt, we can start out with sentry, and "demote" noisy errors to logs or metrics as we see fit.
Edited by Hordur Freyr Yngvason