Tries to execute a function and returns an object with the result of the attempt.
If the function executes successfully, it returns the result inside an object with success: true.
If an error is thrown, it returns the error inside an object with success: false.
An object containing success: true with the result if the function executes successfully,
or success: false with the error if the function throws an error.
Tries to execute a function and returns an object with the result of the attempt. If the function executes successfully, it returns the result inside an object with
success: true. If an error is thrown, it returns the error inside an object withsuccess: false.