Orion
Orion copied to clipboard
Error supports raw data
sample usage: https://github.com/carousell/listing/pull/286 this PR can also tackle for the case when you want to log value from request rather than reporting dynamic error message: https://github.com/carousell/offer/commit/12d647cb5442cd2e6747242620664d7d35031167
test snippets
e := errors.New("test raw data")
notifier.Notify(errors.WrapWithRawData(e, "", req)
I am thinking we can use Functional Options pattern here. Here is the reference http://tmrts.com/go-patterns/idiom/functional-options.html. And here is the patch i created https://github.com/carousell/Orion/compare/master...error-supports-raw-data-patch
Have also changed some logics in the inner function so may need more people to help verify.
@jettbow looks a good idea! However, I rather prefer involving one main change than covering multiple proposals in a PR. Maybe you can create another PR to propose it!
@hothero Yes here it is. https://github.com/carousell/Orion/pull/115
@hothero @benjaminheng could you take this old PR? if not relevant any more, we can close it
we're also defining a new logging/notifier package and we have key/value arguments for reporting already.