Skip to content

Commit

Permalink
fix: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai Sankeerth committed Dec 12, 2024
1 parent d820847 commit c355ca1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class MicrosoftClarity {
if (context?.traits?.customPageId) {
customPageId = context.traits.customPageId;
}
try {
window.clarity('identify', userId, sessionId, customPageId);
} catch (error) {
logger.error('[MicrosoftClarity] Error in identify call: ', error);

const identifyPromise = window.clarity('identify', userId, sessionId, customPageId);

Check warning on line 60 in packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js#L60

Added line #L60 was not covered by tests
if (!!identifyPromise) { // Clarity SDK is ready
identifyPromise.catch(logger.error);

Check warning on line 62 in packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js#L62

Added line #L62 was not covered by tests
}
if (context?.traits) {
const { traits } = context;
Expand Down

0 comments on commit c355ca1

Please sign in to comment.