Using scala.util.control.Exception
Indeed – I also find it pretty confusing! Here’s a problem where I have some property which may be a parseable date: def parse(s: String) : Date = new SimpleDateFormat(“yyyy-MM-dd”).parse(s) def parseDate = parse(System.getProperty(“foo.bar”)) type PE = ParseException import scala.util.control.Exception._ val d1 = try { parseDate } catch { case e: PE => new Date … Read more