July 2017
Intermediate to advanced
796 pages
18h 55m
English
A Scala method can throw an exception because of the unexpected workflow. You create an exception object and then you throw it with the throw keyword as follows. For example:
//code somethingthrow new IllegalArgumentException("arg 2 was wrong...");//nothing will be executed from here.
Note that the primary goal of using exception handling is not to produce friendly messages but to exit the normal flow of your Scala program.
Read now
Unlock full access