aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-18 04:00:15 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-18 04:00:15 +0800
commit2cc03216bd3642c9101c19f309895f0d3b13e82e (patch)
tree50e0e58eec500327bee9564a4738a53d11e8448a
parentcd4e679db79c37d4a2712de1064f952a3ce83585 (diff)
downloaddexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.tar
dexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.tar.gz
dexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.tar.bz2
dexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.tar.lz
dexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.tar.xz
dexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.tar.zst
dexon-sol-tools-2cc03216bd3642c9101c19f309895f0d3b13e82e.zip
manually trigger error and also send in newsletter errors
-rw-r--r--packages/website/ts/@next/components/newsletter_form.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/website/ts/@next/components/newsletter_form.tsx b/packages/website/ts/@next/components/newsletter_form.tsx
index f7cc43964..eef496982 100644
--- a/packages/website/ts/@next/components/newsletter_form.tsx
+++ b/packages/website/ts/@next/components/newsletter_form.tsx
@@ -1,9 +1,9 @@
import * as React from 'react';
import styled, { withTheme } from 'styled-components';
-import { colors } from 'ts/style/colors';
-
import { ThemeValuesInterface } from 'ts/@next/components/siteWrap';
+import { colors } from 'ts/style/colors';
+import { errorReporter } from 'ts/utils/error_reporter';
interface FormProps {
theme: ThemeValuesInterface;
@@ -86,6 +86,10 @@ class Form extends React.Component<FormProps> {
this.setState({ isSubmitted: true });
+ if (email === 'triggererror@0xproject.org') {
+ throw new Error('Manually triggered error');
+ }
+
try {
const response = await fetch('https://website-api.0x.org/newsletter_subscriber/substack', {
method: 'post',
@@ -96,7 +100,7 @@ class Form extends React.Component<FormProps> {
body: JSON.stringify({ email, referrer }),
});
} catch (e) {
- // dosomething
+ errorReporter.report(e);
}
}
}