Empty catch block seems to be invalid in Scala
try { func() } catch { } // error: illegal start of simple expression
How I can catch all
Try adding
case x =>
in your catch block :)
In
import scala.util.Try val res = Try (func()) toOption
if the Try is successful you will get a Some(value), if it fails a None.
Some(value)
None