I\'ve seen many times pieces of scala code using Option (for simple values) or Either[List[Error], T] for handling errors.
this gives place to code like this
The answer varies between what is ideal and what is practical. Ideally, avoid using exceptions. Practically, you can't live without them.
Scala seems to favor one-liners and along those lines v2.10 has the new monad Try:
import scala.util.Try
def percentCompleted( total:Int, done:Int ): Int = Try (done * 100 / total) getOrElse 100
percentCompleted( 0, 10 ) // Catches divide-by-zero and returns 100% instead