Skip to content

Commit

Permalink
improve context & add log to browser
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed Oct 30, 2024
1 parent f9c8ae2 commit 881c45f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/helpers/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ export function prettifyNumber(
try {
formatter = new Intl.NumberFormat(locale, intlOptions);
} catch (e) {
setContext('prettifyNumber', intlOptions);
const ctx = {
value: value.toString(),
intlOptions,
locale: locale ?? navigator.language,
};
setContext('prettifyNumber', ctx);
console.error('[ERROR] prettifyNumber', ctx);
captureException(e);
if (intlOptions.minimumFractionDigits) {
intlOptions.maximumFractionDigits = intlOptions.minimumFractionDigits + 1;
Expand Down

0 comments on commit 881c45f

Please sign in to comment.