Executes an asynchronous function and resolves with an alternative result in case the function failed.