diff --git a/xtrn/lord2/lord2.js b/xtrn/lord2/lord2.js
index ba9063aae6efeb5c55b26cc2b19cf2110e9c3690..8e0a2e9feeae0fff1155a3ae962066820bca1610 100644
--- a/xtrn/lord2/lord2.js
+++ b/xtrn/lord2/lord2.js
@@ -1030,7 +1030,7 @@ function insane_run_ref(sec, fname, refret)
 			var val = replace_vars(getvar(args[2]));
 
 			if (isNaN(rec))
-				throw new Error('@datasave passed invalid rec parameter');
+				throw new Error('@datasave passed invalid rec parameter (' + args[1].toSource() + ' = ' + rec.toSource() + ', all args: ' + args.toSource() + ')');
 			if (!file_exists(f.name)) {
 				if (!f.open('wb'))
 					throw new Error('@datasave unable to create '+f.name);