【发布时间】:2019-05-01 12:02:45
【问题描述】:
为什么要如下代码:
/.../
.onFailure(exc ->
Match(exc).of(
Case($(instanceOf(ServerSOAPFaultException.class)), handleServerSOAPFaultException(exc)),
Case($(instanceOf(Exception.class)), handleDefaultException(exc))
))
.getOrElseGet(exc -> false);
当异常为 RuntimeException 时调用第一种情况。 RuntimeException 不是 ServerSOAPFaultException 的实例。
【问题讨论】: