Handling and logging exceptions in a functional effect system like Effect can be nuanced. Your cu...
Is there a better way / best practice approach to handling this?
What I'm trying to do:
- Catch any unknown exceptions from third-party libraries
- Provide sufficient logging for diagnosing should it come up in production
- Map to an InternalError which has a status code 500 annotation
Currently I'm logging all error causes but it would be good of I can conditionally log error causes when the error is of type UnknownException - haven't quite figured out how to do this yet
What I'm trying to do:
- Catch any unknown exceptions from third-party libraries
- Provide sufficient logging for diagnosing should it come up in production
- Map to an InternalError which has a status code 500 annotation
Currently I'm logging all error causes but it would be good of I can conditionally log error causes when the error is of type UnknownException - haven't quite figured out how to do this yet
