Merge pull request #18579 from overleaf/em-verbose-multi-error

More verbose error on MULTI

GitOrigin-RevId: c1e194063bfd4b4cc88bfb5775af13e1533100d4
This commit is contained in:
Eric Mc Sween 2024-05-29 09:37:27 -04:00 committed by Copybot
parent 134232a1a6
commit e0f6622519

View file

@ -3,6 +3,7 @@ const rclient = require('@overleaf/redis-wrapper').createClient(
Settings.redis.documentupdater
)
const logger = require('@overleaf/logger')
const OError = require('@overleaf/o-error')
const { promisifyAll } = require('@overleaf/promise-utils')
const metrics = require('./Metrics')
const Errors = require('./Errors')
@ -110,7 +111,21 @@ const RedisManager = {
)
}
}
multi.exec(callback)
multi.exec(err => {
if (err) {
callback(
OError.tag(err, 'failed to write doc to Redis in MULTI', {
previousErrors: err.previousErrors.map(e => ({
name: e.name,
message: e.message,
command: e.command,
})),
})
)
} else {
callback()
}
})
}
)
})