diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-21 01:36:12 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-21 01:36:12 +0800 |
commit | 42b3a7c9d756dd2c68256707c0c96a95370329bd (patch) | |
tree | 11d66908433095940a8f8854c593d96585695851 /packages/website/ts/components/token_balances.tsx | |
parent | 33315046cdca3816a9ce1ae281d0bae5600a5cc5 (diff) | |
download | dexon-sol-tools-42b3a7c9d756dd2c68256707c0c96a95370329bd.tar.gz dexon-sol-tools-42b3a7c9d756dd2c68256707c0c96a95370329bd.tar.zst dexon-sol-tools-42b3a7c9d756dd2c68256707c0c96a95370329bd.zip |
Move call to error reporter to end of handler so that even if reporting the error takes a while, it doesn't block the UI
Diffstat (limited to 'packages/website/ts/components/token_balances.tsx')
-rw-r--r-- | packages/website/ts/components/token_balances.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index ab4b04868..2e2ad74e3 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -590,10 +590,10 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala } utils.consoleLog(`Unexpected error encountered: ${err}`); utils.consoleLog(err.stack); - await errorReporter.reportAsync(err); this.setState({ errorType: BalanceErrs.mintingFailed, }); + await errorReporter.reportAsync(err); return false; } } @@ -619,13 +619,13 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala const responseBody = await response.text(); if (response.status !== constants.SUCCESS_STATUS) { utils.consoleLog(`Unexpected status code: ${response.status} -> ${responseBody}`); - await errorReporter.reportAsync(new Error(`Faucet returned non-200: ${JSON.stringify(response)}`)); const errorType = response.status === constants.UNAVAILABLE_STATUS ? BalanceErrs.faucetQueueIsFull : BalanceErrs.faucetRequestFailed; this.setState({ errorType, }); + await errorReporter.reportAsync(new Error(`Faucet returned non-200: ${JSON.stringify(response)}`)); return false; } |