# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1535996668 -7200
# Node ID 397e8e5a2f1f15f9b68e614788c616dada3fc90d
# Parent  cc32aae5c7da2e4914e2b31ee57505484163a3b3
util.dataforms: Improve default error message for failed datatype validation

diff -r cc32aae5c7da -r 397e8e5a2f1f util/dataforms.lua
--- 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;