on master help sign in
handle web3 throwing strings when sending tx

Check if thrown object is a string instead of assuming it's an error Fixes #422

commitfab5bd2aa788e82e073bd9f1efe576dce0fbd179 authorLiam Fitzgerald <liam@urizen.co> dateWed 25 Mar 2020, 09:03 (7 years ago) parentb7567cf
1 file changed+1−1
src/lib/txn.js+1−1
src/lib/txn.js+1−1
@@ -127,7 +127,7 @@ const sendSignedTransaction = (web3, stx, doubtNonceError) => {
127127 // if there's a nonce error, but we used the gas tank, it's likely
128128 // that it's because the tank already submitted our transaction.
129129 // we just wait for first confirmation here.
130− const message = err.message || '';
130+ const message = typeof err === 'string' ? err : err.message || '';
131131 const isKnownError = message.includes('known transaction: ');
132132 const isNonceError =
133133 message.includes("the tx doesn't have the correct nonce.") ||