Handling Unauthorized Errors with Effect.orDie
Hey everyone. I have a little problem in which I hope you can help me solve. I use
I'm sure some of you must have encountered this problem before and am eager to find out how you solved it!
Effect.orDie in some places, for errors that I can't recover from which are mainly network errors, response errors and parsing errors. I have a situation where I need to check for an UnauthorizedError - this can happen if the token expires mid api call and in this case, I want to log the user out or refresh their token and retry. I don't want to pollute my domain with an UnauthorizedError in the E. Here is an example of my issue:I'm sure some of you must have encountered this problem before and am eager to find out how you solved it!
