diff --git a/packages/common/error.js b/packages/common/error.js index e884bb4ac79015f35ecc517034d3654148de0779..34a192f0503889798559b7541f50de4ee7278c91 100644 --- a/packages/common/error.js +++ b/packages/common/error.js @@ -39,6 +39,10 @@ export const handleXhrError = (jqXHR, textStatus, errorThrown, icon = "sad") => "icon": icon, "type": "danger", }); + + if (_paq !== undefined) { + _paq.push(['trackEvent', 'XhrError', body]); + } }; /** @@ -84,4 +88,8 @@ export const handleFetchError = async (error, summary = "", icon = "sad") => { "icon": icon, "type": "danger", }); + + if (_paq !== undefined) { + _paq.push(['trackEvent', 'FetchError', summary === "" ? body : summary + ": " + body]); + } };