Closed klima7 closed 2 years ago
I found the answer in the article connected with this repository. (Just found out about existence of this article, so sorry for stupid question)
What happens with traditional Error Handling?
Observing exceptions (try/catch blocks) and making decisions based on it that changes the control flow is a bad practice: it creates unprediction, affects our resilience and debugging becomes difficult, especially in concurrent environments. Plus going back to C-style error handling, using error codes which need to be checked by convention could be a nightmare.
I'm developing my own clean architecture app and I decided that my data layer is just throwing domain exceptions instead of wrapping them in some kind on Either type. I'm wondering whether wrapping exceptions is really better approach and why. It seems for me more convolutet. Is it really important and what are pros of this solution?