mirror of
https://github.com/tornadocash/tornado-relayer
synced 2024-02-02 15:04:06 +01:00
fix logging error messages
This commit is contained in:
parent
632dce129d
commit
9488090892
@ -39,7 +39,7 @@ async function main() {
|
||||
await redis.hmset('prices', ethPrices)
|
||||
console.log('Wrote following prices to redis', ethPrices)
|
||||
} catch (e) {
|
||||
await logRelayerError(redis, e.message)
|
||||
await logRelayerError(redis, e)
|
||||
console.error('priceWatcher error', e)
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ async function init() {
|
||||
eventSubscription = contract.events.NewAccount({ fromBlock: toBlock + 1 }, processNewEvent)
|
||||
blockSubscription = web3.eth.subscribe('newBlockHeaders', processNewBlock)
|
||||
} catch (e) {
|
||||
await logRelayerError(redis, e.message)
|
||||
await logRelayerError(redis, e)
|
||||
console.error('error on init treeWatcher', e.message)
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ class RelayerError extends Error {
|
||||
}
|
||||
|
||||
const logRelayerError = async (redis, e) => {
|
||||
await redis.zadd('errors', 'INCR', 1, e.message)
|
||||
await redis.zadd('errors', 'INCR', e.score || 1, e.message)
|
||||
}
|
||||
|
||||
const readRelayerErrors = async redis => {
|
||||
|
@ -106,7 +106,7 @@ async function start() {
|
||||
queue.process(processJob)
|
||||
console.log('Worker started')
|
||||
} catch (e) {
|
||||
await logRelayerError(redis, e.message)
|
||||
await logRelayerError(redis, e)
|
||||
console.error('error on start worker', e.message)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user