Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

improve error handling and propagation #655

Open
xcoulon opened this issue Sep 20, 2018 · 0 comments
Open

improve error handling and propagation #655

xcoulon opened this issue Sep 20, 2018 · 0 comments

Comments

@xcoulon
Copy link
Contributor

xcoulon commented Sep 20, 2018

Returning errors from one layer to another in the code (eg: a repository error returned to a service, etc.) using errors.Wrapf(err, ...) is not sufficient, as the top-level error does not include the whole stacktrace, but just a set of messages attached together.
Having a proper stacktrace for each error is important as errors are collected on Sentry and without the stacktrace, it's hard to determine the location of the "root cause".
On the controller level, however, the error should be wrapped with a message that can be returned to the user (e.g.: "the action could not be performed"), but without passing the whole stacktrace nor the root cause.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant