function withAsyncBody(bodyFn) {
        // eslint-disable-next-line no-async-promise-executor
        return new Promise(async (resolve, reject) => {
            try {
                await bodyFn(resolve, reject);
            }
            catch (error) {
                reject(error);
            }
        });
    }
A helper to create a new `Promise<T>` with a body that is a promise
itself. By default, an error that raises from the async body will
end up as a unhandled rejection, so this utility properly awaits the
body and rejects the promise as a normal promise does without async
body.

This method should only be used in rare cases where otherwise `async`
cannot be used (e.g. when callbacks are involved that require this).