react-yandex-metrika icon indicating copy to clipboard operation
react-yandex-metrika copied to clipboard

Dot not catch exceptions on Ya Metrik API calls

Open DavyJohnes opened this issue 5 years ago • 3 comments

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.

DavyJohnes avatar Jul 08 '20 17:07 DavyJohnes

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

hcodes avatar Aug 07 '20 11:08 hcodes

a case of beer if you merge it for the day

personaljs avatar Aug 07 '20 11:08 personaljs

@narkq ping

DavyJohnes avatar Sep 14 '20 09:09 DavyJohnes