-
Notifications
You must be signed in to change notification settings - Fork 4
workflow
Michael Kenney edited this page Aug 14, 2018
·
7 revisions
- start
var errs errors.Err var err error
- error occurs in come code somewhere
err = someFunc()
- capture and wrap the error to add context
if nil != err { errs = errors.Wrap(err, 0, "the call to someFunc to do some particular work failed") }
- do some more work, repeat
// if someFunc failed do a thing if nil != err { errs = errors.Wrap(err, 0, "the call to someFunc to do some particular work failed") err = buidSome() if nil != err { errs = errors.Wrap(err, 0, "could not build 'some'") } }
footer