aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-12 09:52:22 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-13 06:54:45 +0800
commitf4b2a9625dd46080a4fd05754c525f73e5fff8b1 (patch)
treed8658191567c6ad4273c666c2c80df0afdde42e7 /packages/website/ts
parent9b387b8ec3c543b5c96d1887550797a2bb90fe94 (diff)
downloaddexon-sol-tools-f4b2a9625dd46080a4fd05754c525f73e5fff8b1.tar.gz
dexon-sol-tools-f4b2a9625dd46080a4fd05754c525f73e5fff8b1.tar.zst
dexon-sol-tools-f4b2a9625dd46080a4fd05754c525f73e5fff8b1.zip
Only upload sourcemaps to rollbar on live deploys, and log NaN error for future debugging
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/utils/utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 9ca7f607b..e515cdeb3 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -29,6 +29,7 @@ import {
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
import * as u2f from 'ts/vendor/u2f_api';
+import { errorReporter } from './error_reporter';
const isDogfood = (): boolean => _.includes(window.location.href, configs.DOMAIN_DOGFOOD);
@@ -389,6 +390,9 @@ export const utils = {
: 2;
const format = `0,0.${_.repeat('0', precision)}`;
const formattedAmount = numeral(unitAmount).format(format);
+ if (_.isNaN(formattedAmount)) {
+ throw new Error(`amount ${BigNumber}, decimals ${decimals} could not be formatted and returned NaN.`);
+ }
return formattedAmount;
},
getUsdValueFormattedAmount(amount: BigNumber, decimals: number, price: BigNumber): string {