AuthenticationException GetException(ErrorHTTPAuthentication code) { switch (code) { case ErrorHTTPAuthentication.BadUserName: throw new InvalidCredentialException("Bad username."); case ErrorHTTPAuthentication.BadPassword: throw new InvalidCredentialException("Bad password."); case ErrorHTTPAuthentication.TypeUnsupported: throw new AuthenticationException("Authentication type not supported."); default: throw new AuthenticationException("Unknown error."); } }
AuthenticationException GetException (ErrorHTTPAuthentication code) { switch (code) { case ErrorHTTPAuthentication.BadUserName: throw new InvalidCredentialException ("Bad username."); case ErrorHTTPAuthentication.BadPassword: throw new InvalidCredentialException ("Bad password."); case ErrorHTTPAuthentication.TypeUnsupported: throw new AuthenticationException ("Authentication type not supported."); default: throw new AuthenticationException ("Unknown error."); } }