I’m converting junit java unit tests to scala unit tests. These tests are throwing exceptions as part of their method signatures. When I convert the test to scala I am no longer required to throw these exceptions.
EDIT : The junit tests after being converted to scala compiles and runs throwing the exceptions. What is the reason for this ?
There has been a lot of discussion on the benefit (or lack there of) of checked exceptions. Interestingly while java knows checked exceptions, the JVM does not. So the designers of Scala just decided to go without checked exceptions.
The idea of checked exception was to force the developer to handle some exceptions. But it turned out this resulted in lots of extremely useless exception handling code, obfuscating the intend of the main code or swallowing exceptions or both.