From 1cc043d7a9d2c7bbdfc6b692ca30b8af8d6b8606 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 4 Dec 2018 15:58:36 -0800 Subject: feat(instant): input to trigger error for rollbar testing --- packages/instant/src/components/scaling_amount_input.tsx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/instant/src/components') diff --git a/packages/instant/src/components/scaling_amount_input.tsx b/packages/instant/src/components/scaling_amount_input.tsx index 0861bbe05..f95020461 100644 --- a/packages/instant/src/components/scaling_amount_input.tsx +++ b/packages/instant/src/components/scaling_amount_input.tsx @@ -4,6 +4,7 @@ import * as React from 'react'; import { Maybe } from '../types'; +import { MAGIC_TRIGGER_ERROR_INPUT } from '../constants'; import { ColorOption } from '../style/theme'; import { maybeBigNumberUtil } from '../util/maybe_big_number'; import { util } from '../util/util'; @@ -71,6 +72,10 @@ export class ScalingAmountInput extends React.Component): void => { + if (event.target.value === MAGIC_TRIGGER_ERROR_INPUT) { + throw new Error('Triggered error'); + } + const sanitizedValue = event.target.value.replace(/[^0-9.]/g, ''); // only allow numbers and "." this.setState({ stringValue: sanitizedValue, -- cgit From a138ee7e836a2ddb7a2ae317fe56dddaca5703ff Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 4 Dec 2018 16:10:56 -0800 Subject: Add GIT_SHA and NPM_VERSION constants, report git and npm version in error --- packages/instant/src/components/scaling_amount_input.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/instant/src/components') diff --git a/packages/instant/src/components/scaling_amount_input.tsx b/packages/instant/src/components/scaling_amount_input.tsx index f95020461..86aca5a65 100644 --- a/packages/instant/src/components/scaling_amount_input.tsx +++ b/packages/instant/src/components/scaling_amount_input.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { Maybe } from '../types'; -import { MAGIC_TRIGGER_ERROR_INPUT } from '../constants'; +import { GIT_SHA, MAGIC_TRIGGER_ERROR_INPUT, MAGIC_TRIGGER_ERROR_MESSAGE, NPM_PACKAGE_VERSION } from '../constants'; import { ColorOption } from '../style/theme'; import { maybeBigNumberUtil } from '../util/maybe_big_number'; import { util } from '../util/util'; @@ -73,7 +73,7 @@ export class ScalingAmountInput extends React.Component): void => { if (event.target.value === MAGIC_TRIGGER_ERROR_INPUT) { - throw new Error('Triggered error'); + throw new Error(`${MAGIC_TRIGGER_ERROR_MESSAGE} git: ${GIT_SHA}, npm: ${NPM_PACKAGE_VERSION}`); } const sanitizedValue = event.target.value.replace(/[^0-9.]/g, ''); // only allow numbers and "." -- cgit