mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-24 11:38:00 +01:00
[extensions] Improve IAE message thrown by FormFieldRegistry
This commit is contained in:
parent
8133505050
commit
e504bc23cf
1 changed files with 7 additions and 1 deletions
|
@ -94,7 +94,13 @@ public class FormFieldRegistry {
|
|||
} else {
|
||||
previousType = fieldNameToType.get(fieldName);
|
||||
if (previousType != null && previousType != fieldType) {
|
||||
throw new IllegalArgumentException();
|
||||
String message = "The field '" + fieldName + "' from form type '" + formType
|
||||
+ "' was already registered with field type '" + previousType
|
||||
+ "' while it is now seen with type '" + fieldType
|
||||
+ "'. Form field types have to be unambigiously."
|
||||
+ " XMPP uses a registry for form field tpes, scoped by the form type."
|
||||
+ " You may find the correct value at https://xmpp.org/registrar/formtypes.html";
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
previousType = fieldNameToType.put(fieldName, fieldType);
|
||||
|
|
Loading…
Reference in a new issue