Compare commits

..
6 Commits
Author SHA1 Message Date
Chris Troutner d59c1fe445 Merge pull request #123 from Permissionless-Software-Foundation/ct-unstable
fix(decodeOpReturn): Trying different error configuration
2021-02-27 10:03:58 -08:00
Chris Troutner 0a34611557 fix(decodeOpReturn): Trying different error configuration 2021-02-27 10:02:12 -08:00
Chris Troutner c13b029e99 Merge pull request #122 from Permissionless-Software-Foundation/ct-unstable
fix(decodeOpReturn): Replacing error message with better one
2021-02-27 09:47:20 -08:00
Chris Troutner b038e9a7fd fix(decodeOpReturn): Replacing error message with better one 2021-02-27 09:45:24 -08:00
Chris Troutner 7b728fb45d Merge pull request #121 from Permissionless-Software-Foundation/ct-unstable
fix(decodeOpReturn): Adding additional debugging for errors
2021-02-27 09:33:00 -08:00
Chris Troutner d4dbce8df0 fix(decodeOpReturn): Adding additional debugging for errors 2021-02-27 09:31:16 -08:00
+15 -3
View File
@@ -1016,7 +1016,15 @@ class Utils {
return tokenData
} catch (error) {
console.log('decodeOpReturn error: ', error)
if (error.response && error.response.data) throw error.response.data
console.log(`decodeOpReturn error.message: ${error.message}`)
// if (error.response && error.response.data) {
// // throw error.response.data
//
// // error.bchApiMessage = error.message
// // error.message = error.response.data
// // error.data = error.response.data
// }
throw error
}
}
@@ -1239,6 +1247,7 @@ class Utils {
// This is a private function that is called by tokenUtxoDetails().
// It loops through an array of UTXOs and tries to hydrate them with SLP
// token information from the OP_RETURN data.
// If this function hits a rate limit... TODO: describe specific behavior.
async _hydrateUtxo (utxos, usrObj = null) {
try {
const decodeOpReturnCache = {}
@@ -1264,7 +1273,10 @@ class Utils {
)
// console.log(`slpData: ${JSON.stringify(slpData, null, 2)}`)
} catch (err) {
console.log(`error in _hydrateUtxo() from decodeOpReturn(${utxo.txid}): `, err)
console.log(
`error in _hydrateUtxo() from decodeOpReturn(${utxo.txid}): `,
err
)
// An error will be thrown if the txid is not SLP.
// If error is for some other reason, like a 429 error, mark utxo as 'null'
@@ -1276,7 +1288,7 @@ class Utils {
err.message.indexOf('trailing data') === -1)
) {
console.log(
'unknown error from decodeOpReturn(). Marking as \'null\'',
"unknown error from decodeOpReturn(). Marking as 'null'",
err
)