Originally reported here
If a lambda passed to withTransaction results in a rejected promise with no reason, the driver assumes a valid value and tries to check for an error code.
For example, this will fail:
const session = await client.startSession()
await session.withTransaction(s => Promise.reject());