diff --git a/src/client.rs b/src/client.rs index b5f8f4e2..70bf1767 100644 --- a/src/client.rs +++ b/src/client.rs @@ -191,6 +191,11 @@ impl Client { } } } + else if n.is("failure", ns::SASL) { + let msg = n.text(); + let inner = if msg == "" { None } else { Some(msg) }; + return Err(Error::SaslError(inner)); + } else if n.is("iq", ns::CLIENT) && n.has_child("bind", ns::BIND) { return Ok(()); } diff --git a/src/error.rs b/src/error.rs index 1d8e373f..81f41fef 100644 --- a/src/error.rs +++ b/src/error.rs @@ -24,6 +24,7 @@ pub enum Error { OpenSslErrorStack(ErrorStack), MinidomError(MinidomError), Base64Error(Base64Error), + SaslError(Option), StreamError, EndOfDocument, }