util.dataforms: Improve default error message for failed datatype validation

This commit is contained in:
Kim Alvefur 2018-09-03 19:44:28 +02:00
parent a6d4c6c8f6
commit 715b488722

View file

@ -187,7 +187,7 @@ function form_t.data(layout, stanza, current)
if valid then
value = ret;
else
value, err = nil, ret or field.datatype;
value, err = nil, ret or ("Invalid value for data of type " .. field.datatype);
end
end
data[field.name], errors[field.name] = value, err;