The return type of the async function
The type of the error (defaults to Error)
The async function to execute
Whether to throw the error instead of returning a Result (defaults to false)
A Promise that resolves to a Result containing either the function's return value or an error
Wraps an async function in a try-catch block and returns a Result.