Wrapping Function X to Handle Errors
Let's say I have function X that can throw an error at any given time
I want to wrap this function with some utils so that if an error is thrown I will return
I want to wrap this function with some utils so that if an error is thrown I will return
{ success: false, error: string}, otherwise, return { success: true, data }. I'd assume Effect can help here, what would be the correct pattern?