Skip to content

Commit d08e16a

Browse files
committed
fixup! Fix promiseTimeout to cleanup setTimeout
1 parent ba35dfe commit d08e16a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/ratesEngine.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ async function updateTxValuesV3(transaction: DbTx): Promise<void> {
189189
},
190190
body: JSON.stringify(ratesRequest)
191191
})
192+
if (!ratesResponse.ok) {
193+
if (ratesResponse.status === 429) {
194+
datelog('Rate limit hit')
195+
}
196+
const text = await ratesResponse.text()
197+
throw new Error(`Rates v3 error: ${text}`)
198+
}
192199
const ratesResponseJson = await ratesResponse.json()
193200
const rates = asRatesV3Params(ratesResponseJson)
194201
const depositRateObf = depositIsFiat

0 commit comments

Comments
 (0)