narkq / react-yandex-metrika

React component for Yandex.Metrika
128 stars 25 forks source link

Dot not catch exceptions on Ya Metrik API calls #45

Open DavyJohnes opened 4 years ago

DavyJohnes commented 4 years ago

I think this is more useful to pass any error from YM API up to caller in service which uses this library. Currently, library users are not able to handle errors in YM API calls (as a result can't figure out why, for example, some goals are not tracked). I think my approach is more flexible since library users may wrap ym calls with their own wrappers which uses try { ym(...) } catch(e) {} and do something with these errors.

hcodes commented 4 years ago

/cc @narkq All Metrica methods are already wrapped in try catch inside tag.js. In this code, this is not necessary.

personaljs commented 4 years ago

a case of beer if you merge it for the day

DavyJohnes commented 4 years ago

@narkq ping