mod_storage_sql2: Don't ignore failure in keyval_store:get() (thanks daurnimator)
authorKim Alvefur <zash@zash.se>
Fri, 20 Jun 2014 16:16:33 +0200
changeset 6282 bce801e40484
parent 6281 8dc01fa767e0
child 6283 7cf6d3a2c855
mod_storage_sql2: Don't ignore failure in keyval_store:get() (thanks daurnimator)
plugins/mod_storage_sql2.lua
--- a/plugins/mod_storage_sql2.lua	Fri Jun 20 16:10:04 2014 +0200
+++ b/plugins/mod_storage_sql2.lua	Fri Jun 20 16:16:33 2014 +0200
@@ -198,7 +198,9 @@
 keyval_store.__index = keyval_store;
 function keyval_store:get(username)
 	user,store = username,self.store;
-	return select(2, engine:transaction(keyval_store_get));
+	local ok, result = engine:transaction(keyval_store_get);
+	if not ok then return ok, result; end
+	return result;
 end
 function keyval_store:set(username, data)
 	user,store = username,self.store;