Orion icon indicating copy to clipboard operation
Orion copied to clipboard

Error supports raw data

Open hothero opened this issue 5 years ago • 4 comments

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)

image

hothero avatar Mar 28 '19 04:03 hothero

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 avatar Aug 06 '19 17:08 jettbow

@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 avatar Aug 13 '19 09:08 hothero

@hothero Yes here it is. https://github.com/carousell/Orion/pull/115

jettbow avatar Aug 13 '19 09:08 jettbow

@hothero @benjaminheng could you take this old PR? if not relevant any more, we can close it

achichen avatar Sep 13 '22 01:09 achichen

we're also defining a new logging/notifier package and we have key/value arguments for reporting already.

hothero avatar Mar 28 '23 03:03 hothero