# fromFailure static method

SaslError fromFailure(

1. XMLNode failure

)

## Implementation

    static SaslError fromFailure(XMLNode failure) {
      XMLNode? error;
      for (final child in failure.children) {
        if (child.tag == 'text') continue;

        error = child;
        break;
      }

      switch (error?.tag) {
        case 'credentials-expired':
          return SaslCredentialsExpiredError();
        case 'not-authorized':
          return SaslNotAuthorizedError();
        case 'account-disabled':
          return SaslAccountDisabledError();
      }

      return SaslUnspecifiedError();
    }