As a java programmer, I have always been critical of Unchecked Exceptions. Mostly programmers use it as an en-route to coding easiness only to create trouble later. Also the programs (though untidy) with checked exceptions are much robust compared to unchecked counterparts.Surprisingly in Scala, there is nothing called Checked Exceptions. All the Java checked and unchecked are unchecked in Scala. What is the motivation behind this decision? For me it opens wide range of problems when using any external code. And if by chance the documentation is poor, it results in KILL.
Decision for Unchecked Exceptions in Scala
java;scala;exceptions;exception handling
Checked exceptions are mostly considered a failure. Note that no languages created after Java adopted them. See http://www.artima.com/intv/handcuffs2.html, http://googletesting.blogspot.ru/2009/09/checked-exceptions-i-love-you-but-you.html, http://www.mindview.net/Etc/Discussions/CheckedExceptions, etc.In particular, they are uncomposable (except by reverting to throws Exception).In Scala you have a better option: using algebraic types for return values such as Option[T], Either[Exception, T], your own type when you want the user to handle specific cases (e.g. instead ofdef foo: Int // throws FileNotFoundException, IllegalStateExceptionyou havesealed trait FooResultcase class Success(value: Int) extends FooResultcase class FileNotFound(file: File) extends FooResultcase object IllegalState extends FooResultdef foo: FooResultand the consumer now is required to handle all results)For dealing with external code which does throw exceptions, you have scala.util.control.exception or scala.util.Try (starting with Scala 2.10).