Wrap existing synchronous Scala code that can throw exceptions using ZIO.attempt to create a ZIO effect and handle errors.
Differentiate between using ZIO.attempt for code that can potentially throw exceptions and ZIO.succeed for code that absolutely cannot fail.
Use refineToOrDie method in ZIO to specify the exact type of exception that can be thrown by the existing code, rather than just catching Throwable.
Collection
[
|
...
]