Skip to content

Commit 2f762a8

Browse files
authored
fix(extension): use debug statements in favour of error (#1738)
- don't catch console errors in production
1 parent e778f66 commit 2f762a8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/browser-extension-wallet/sentry.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Sentry.init({
88
Sentry.browserTracingIntegration(),
99
Sentry.browserProfilingIntegration(),
1010
Sentry.replayIntegration(),
11-
Sentry.captureConsoleIntegration({ levels: ['error'] })
11+
// TODO: re-enable once we've reviewed provider logging
12+
Sentry.captureConsoleIntegration({ levels: process.env.SENTRY_ENVIRONMENT === 'production' ? [] : ['error'] })
1213
],
1314
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
1415
tracePropagationTargets: ['localhost', 'chrome-extension://gafhhkghbfjjkeiendhlofajokpaflmk'],

apps/browser-extension-wallet/src/lib/scripts/background/onError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const handleConnectionIssues = async (error: WebRequest.OnErrorOccurredDetailsTy
4646
)
4747
return;
4848

49-
logger.error('xmlhttprequest:net::ERR_INTERNET_DISCONNECTED', error);
49+
logger.debug('xmlhttprequest:net::ERR_INTERNET_DISCONNECTED', error);
5050

5151
requestMessage$.next({ type: MessageTypes.HTTP_CONNECTION, data: { connected: false } });
5252
if (!webRequest.onCompleted.hasListener(handleRequests)) {

apps/browser-extension-wallet/src/lib/scripts/background/services/utilityServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const fetchTokenPrices = () => {
178178
coinPrices.tokenPrices$.next({ tokens: tokenPrices, status: 'fetched' });
179179
})
180180
.catch((error) => {
181-
logger.error('Error fetching coin prices:', error);
181+
logger.debug('Error fetching token prices:', error);
182182
coinPrices.tokenPrices$.next({ ...coinPrices.tokenPrices$.value, status: 'error' });
183183
});
184184
};
@@ -204,7 +204,7 @@ const fetchAdaPrice = () => {
204204
});
205205
})
206206
.catch(async (error) => {
207-
logger.error('Error fetching coin prices:', error);
207+
logger.debug('Error fetching coin prices:', error);
208208
// If for some reason we couldn't fetch the ada price, get it from background store
209209
const adaPrice = await getADAPriceFromBackgroundStorage();
210210
if (!adaPrice) return coinPrices.adaPrices$.next({ prices: {}, status: 'error', timestamp: undefined });

0 commit comments

Comments
 (0)