Wraps a promise to catch errors and return a Result tuple. This allows for cleaner error handling without try-catch blocks.
A tuple of [error, null] on failure or [null, data] on success
The promise to wrap
Wraps a promise to catch errors and return a Result tuple. This allows for cleaner error handling without try-catch blocks.
Returns
A tuple of [error, null] on failure or [null, data] on success