fix(removeStaleOffers): Better error handling

This commit is contained in:
Chris Troutner
2022-05-02 13:31:22 -07:00
parent 09cbfd00e8
commit 2c1c009b64
+1 -1
View File
@@ -359,7 +359,7 @@ class OfferUseCases {
// console.log('utxoStatus: ', utxoStatus)
} catch (err) {
// Handle corner case of bad-data in the Offer model.
if (err.message.includes('txid needs to be a proper transaction ID')) {
if (err.message && err.message.includes('txid needs to be a proper transaction ID')) {
console.log(`Deleting Offer with bad data: ${JSON.stringify(thisOffer, null, 2)}`)
await thisOffer.remove()
continue