(Based on this, strongly recommended for an in-depth article, tutorial on error dealing with Cats)
Business/application errors should be modeled in the application and be part of a monad transformer (usually EitherT
)to enrich the effect with the errors or the value depending on the result of a computation (for a longer explanation, example, see here).
But this only counts for those business or application errors (those ones you can control as they are part of the business logic), there are technical errors due to connection failures, file system issues, misconfiguration, ... Those ones are real exceptional errors which have to be dealt with. Those exception errors (actually exceptions) can be raised and recovered inside IO
s
and have a ubiquitous use