A helper function that wraps a Promise and returns a tuple of [error, data].
If the Promise resolves successfully, the first element of the tuple will be null, and the second element will be the resolved value.
If the Promise is rejected, the first element of the tuple will be the error, and the second element will be undefined.
A helper function that wraps a Promise and returns a tuple of [error, data]. If the Promise resolves successfully, the first element of the tuple will be null, and the second element will be the resolved value. If the Promise is rejected, the first element of the tuple will be the error, and the second element will be undefined.