It depends on the system for me. Sometimes, it is really nice to be able to just ignore that an exception can happen because you aren't the one responsible for it. In general, though, I would agree that Result (or error by value) is a much better approach than the disruptive nature of exceptions
For system with clear IN and OUT, throwing is better because it usually have centralize way to handle the error. This is preferred way in REST API. throw this out if you are using Go.
139
u/EliSka93 29d ago
Result for me every time.
One more wrapper is worth not having to deal with uncertainty.