Handling Error States in effect-http with Type Checking for API Responses
I'm having an issue recovering from an error state in effect-http.
I have a route, that if i don't handle my errors - is type checking. So I have a spec defined with two possible responses, a 200 response & body and a 401 response & body.
basically like this
My understanding is, I need my route to return one of these shapes at least.
and this code here is what i'm basically trying to do
So the commented out code, trying to recover from possible error states, is what makes typescript upset. Its basically saying its missing types from the Success channel of that effect that I yield.
I thought that if my
I have a route, that if i don't handle my errors - is type checking. So I have a spec defined with two possible responses, a 200 response & body and a 401 response & body.
basically like this
My understanding is, I need my route to return one of these shapes at least.
and this code here is what i'm basically trying to do
So the commented out code, trying to recover from possible error states, is what makes typescript upset. Its basically saying its missing types from the Success channel of that effect that I yield.
I thought that if my
post errors, i would catch the tags that it throws and return the error shape I defined.