changeset 1537:f7649ad6e3e7

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 07 Aug 2020 13:38:25 -0600
parents 34ae786771b6
children 634f6765830e
files src/luan/modules/lucene/Web_search.luan
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r 34ae786771b6 -r f7649ad6e3e7 src/luan/modules/lucene/Web_search.luan
--- a/src/luan/modules/lucene/Web_search.luan	Fri Aug 07 13:34:25 2020 -0600
+++ b/src/luan/modules/lucene/Web_search.luan	Fri Aug 07 13:38:25 2020 -0600
@@ -227,9 +227,13 @@
 	local old = Http.request.parameters.old
 	old = eval( old, "lucene", Number )
 	local id = Http.request.parameters.id
+	local msg = "Lucene Updated"
 	index.run_in_transaction( function()
 		local current = index.get_document("id:"..id)
-		equal(current,old) or error "document has changed"
+		if not equal(current,old) then
+			msg = "ERROR: document has changed"
+			return
+		end
 		if doc == nil then
 			index.delete("id:"..id)
 		else
@@ -246,7 +250,7 @@
 		</style>
 	</head>
 	<body>
-		<h2>Lucene Updated</h2>
+		<h2><%=msg%></h2>
 	</body>
 </html>
 <%