textElement.setErrorKey("form.name.xing.error", null);
result = false;
} else {
// In case of any exception, assume that the given MSN name is valid (The opposite would block easily upon network problems), and inform the user about this.
textElement.setExampleKey("form.example.xingname.notvalidated", null);
log.warn("Xing name validation: Expected HTTP status 200 or 301, but got " + httpStatusCode);
result = true;
}
} catch (IllegalArgumentException e) {
// The xing name is not url compatible (e.g. contains whitespaces)
textElement.setErrorKey("form.xingname.notvalid", null);