static AuthenticationException CreateAuthenticationException (ImapCommand ic)
{
if (string.IsNullOrEmpty (ic.ResponseText)) {
for (int i = 0; i < ic.RespCodes.Count; i++) {
if (ic.RespCodes[i].IsError || ic.RespCodes[i].Type == ImapResponseCodeType.Alert)
return new AuthenticationException (ic.RespCodes[i].Message);
}
return new AuthenticationException ();
}
return new AuthenticationException (ic.ResponseText);
}