Diff

util/dataforms.lua @ 9246:397e8e5a2f1f

util.dataforms: Improve default error message for failed datatype validation
author Kim Alvefur <zash@zash.se>
date Mon, 03 Sep 2018 19:44:28 +0200
parent 9243:a4c52e304e6f
child 11026:a086825ed73a
line wrap: on
line diff
--- a/util/dataforms.lua	Sat Sep 01 03:02:44 2018 +0200
+++ b/util/dataforms.lua	Mon Sep 03 19:44:28 2018 +0200
@@ -187,7 +187,7 @@
 					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;