Creating a function to handle a specific error tag while maintaining type safety and flexibility ...
How can I create a function to handle a specific error tag?
I have several function that uses HttpClient from the @effect/platform package. When I use
My attempt has been
But some API calls do not have request body, and thus do not yield HttpBodyError, but this function makes every API function to have HttpBodyError.
This does not work
I think E needs to extend something that is compatible with yieldable Error (with _tag), although E can be nothing as well.
I have several function that uses HttpClient from the @effect/platform package. When I use
filterStatusOk, I don't get the error response in the error; the response content is hidden in the Effect named json. I tried to bring out the error content but I cannot create a function generic enough.My attempt has been
But some API calls do not have request body, and thus do not yield HttpBodyError, but this function makes every API function to have HttpBodyError.
This does not work
I think E needs to extend something that is compatible with yieldable Error (with _tag), although E can be nothing as well.
