异常中也可以使用case 匹配异常类型 try { remoteCalculatorService.add(1, 2)} catch { case e: ServerIsDownException => log.error(e, "the remote calculator service is unavailable. should have kept your trusty HP.")} finally { remoteCalculatorService.close()}