Changeset

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
parents 9245:cc32aae5c7da
children 9247:26854d7a4947
files util/dataforms.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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;