Skip to content

Commit

Permalink
fix(extension): use debug statements in favour of error (#1738)
Browse files Browse the repository at this point in the history
- don't catch console errors in production
  • Loading branch information
mchappell authored Feb 24, 2025
1 parent e778f66 commit 2f762a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apps/browser-extension-wallet/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Sentry.init({
Sentry.browserTracingIntegration(),
Sentry.browserProfilingIntegration(),
Sentry.replayIntegration(),
Sentry.captureConsoleIntegration({ levels: ['error'] })
// TODO: re-enable once we've reviewed provider logging
Sentry.captureConsoleIntegration({ levels: process.env.SENTRY_ENVIRONMENT === 'production' ? [] : ['error'] })
],
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
tracePropagationTargets: ['localhost', 'chrome-extension://gafhhkghbfjjkeiendhlofajokpaflmk'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const handleConnectionIssues = async (error: WebRequest.OnErrorOccurredDetailsTy
)
return;

logger.error('xmlhttprequest:net::ERR_INTERNET_DISCONNECTED', error);
logger.debug('xmlhttprequest:net::ERR_INTERNET_DISCONNECTED', error);

requestMessage$.next({ type: MessageTypes.HTTP_CONNECTION, data: { connected: false } });
if (!webRequest.onCompleted.hasListener(handleRequests)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const fetchTokenPrices = () => {
coinPrices.tokenPrices$.next({ tokens: tokenPrices, status: 'fetched' });
})
.catch((error) => {
logger.error('Error fetching coin prices:', error);
logger.debug('Error fetching token prices:', error);
coinPrices.tokenPrices$.next({ ...coinPrices.tokenPrices$.value, status: 'error' });
});
};
Expand All @@ -204,7 +204,7 @@ const fetchAdaPrice = () => {
});
})
.catch(async (error) => {
logger.error('Error fetching coin prices:', error);
logger.debug('Error fetching coin prices:', error);
// If for some reason we couldn't fetch the ada price, get it from background store
const adaPrice = await getADAPriceFromBackgroundStorage();
if (!adaPrice) return coinPrices.adaPrices$.next({ prices: {}, status: 'error', timestamp: undefined });
Expand Down

0 comments on commit 2f762a8

Please sign in to comment.