From a714d35635feeb2ecf4b02aacfd4ec7238bf5660 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 23 Dec 2021 11:49:08 -0800 Subject: [PATCH] fix(handleMutableData): Making error handling less noisy and more informative --- src/components/admin-lte/tokens/index.js | 107 ++++++++++++----------- 1 file changed, 56 insertions(+), 51 deletions(-) diff --git a/src/components/admin-lte/tokens/index.js b/src/components/admin-lte/tokens/index.js index ba28ba9..5f3a996 100644 --- a/src/components/admin-lte/tokens/index.js +++ b/src/components/admin-lte/tokens/index.js @@ -31,22 +31,22 @@ class Tokens extends React.Component { return ( <> - - + + {_this.state.txId} @@ -71,46 +71,46 @@ class Tokens extends React.Component { )} {_this.state.inFetch ? ( -
- Loading... -
+
+ Loading... +
) : ( - - {_this.state.errMsg && ( - - - - {_this.state.errMsg} - - - - )} + + {_this.state.errMsg && ( + + + + {_this.state.errMsg} + + + + )} - {_this.state.tokens.length > 0 && ( - <> - - {_this.state.tokens.map((val, i) => { - if (val.qty > 0) { - return ( - - - - ) - } else { - return - } - })} - - - )} - + {_this.state.tokens.length > 0 && ( + <> + + {_this.state.tokens.map((val, i) => { + if (val.qty > 0) { + return ( + + + + ) + } else { + return + } + })} + + + )} + )} FullStack.cash
@@ -259,7 +260,7 @@ class Tokens extends React.Component { if (bchjs.restURL.includes('abc.fullstack')) { explorerURL = 'https://explorer.be.cash/tx' } else { - explorerURL = 'https://explorer.bitcoin.com/bch/tx' + explorerURL = 'https://blockchair.com/bitcoin-cash/transaction' } _this.setState({ explorerURL @@ -278,14 +279,18 @@ class Tokens extends React.Component { token.mutableData = data // console.log(`data: ${JSON.stringify(data, null, 2)}`) } catch (error) { - console.warn(error) + // console.warn(error) // Skip error + console.log( + `Could not access mutable data for ${token.ticker} (${token.tokenId})` + ) } tokens.push(token) } return tokens } catch (error) { + console.log('Error in handleMutableData()') console.warn(error) } }