on master help sign in
handle web3 throwing strings when sending tx
fab5bd2Liam Fitzgerald
src/lib/txn.js+1−1
@@ -127,7 +127,7 @@ const sendSignedTransaction = (web3, stx, doubtNonceError) => {
127 // if there's a nonce error, but we used the gas tank, it's likely
127 // if there's a nonce error, but we used the gas tank, it's likely
128 // that it's because the tank already submitted our transaction.
128 // that it's because the tank already submitted our transaction.
129 // we just wait for first confirmation here.
129 // we just wait for first confirmation here.
130− const message = err.message || '';
130+ const message = typeof err === 'string' ? err : err.message || '';
131 const isKnownError = message.includes('known transaction: ');
131 const isKnownError = message.includes('known transaction: ');
132 const isNonceError =
132 const isNonceError =
133 message.includes("the tx doesn't have the correct nonce.") ||
133 message.includes("the tx doesn't have the correct nonce.") ||