isFaultError function

bool isFaultError(
  1. Object error
)

RpcStatus.isFault for a caught error. A throw that carries no status is a fault: an unclassifiable failure is not an application answering. An RpcPeerFaultException is not, whatever its status: the peer sent it.

Implementation

bool isFaultError(Object error) {
  if (error is RpcPeerFaultException) return false;
  return error is! RpcStatusException || error.statusCode.isFault;
}