Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change error passing to add context #16

Open
alexbeltran opened this issue Dec 21, 2017 · 0 comments
Open

Change error passing to add context #16

alexbeltran opened this issue Dec 21, 2017 · 0 comments

Comments

@alexbeltran
Copy link
Owner

Currently all errors are simply passed. Adding a little bit of context as we pass it up the chain will help with debugging.

i.e.

_, err := os.Create()
if err != nil{
    return fmt.Errof("unable to create file: %v")
}

instead of

_, err := os.Create()
if err != nil{
    return err
}

This would be useful when passing up the chain since there are multiple stages and packages used for each command called. An example would be an error in the encoding portion could give additional context in the net layer so we know at what point it fails.

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

No branches or pull requests

1 participant