Scala : Error handling: generic exception