title: Handling errors in scala ZIO
body: <p>I wanted to handle some exceptions in ZIO using catchAll or catchSome as the below : </p>
  
  <pre><code>object Test extends App {
  
    def run(args: List[String]) =
      myApp.fold(_ =&gt; 1, _ =&gt; 0)
  
   val myApp =
      for {
        _ &lt;- putStrLn(unsafeRun(toINT("3")).toString)
      } yield ()
  
  def toINT(s: String): IO[IOException, Int]= {
       IO.succeed(s.toInt).map(v =&gt; v).catchAll(er =&gt;IO.fail(er))
    }
  
  </code></pre>
  
  <p>the code succeeded in case I passed a valid format number but it's unable to   handle the exception in case I passed invalid format and idea ??  </p>