Commit 90d42a50 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Always return an IQ error if an error occured during the registration. JM-215


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1133 b35dd754-fafc-0310-a699-88a17e54d16e
parent c1eea815
......@@ -305,7 +305,23 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.bad_request);
}
catch (IllegalArgumentException e) {
// The specified username is not correct according to the stringprep specs
reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.jid_malformed);
}
catch (UnsupportedOperationException e) {
// The User provider is read-only so this operation is not allowed
reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.not_allowed);
}
catch (Exception e) {
// Some unexpected error happened so return an internal_server_error
reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.internal_server_error);
Log.error(e);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment