diff mod_http_admin_api/mod_http_admin_api.lua @ 6332:1fc38a840baa

mod_http_admin_api: Pass util.error object as response when request fails
author Matthew Wild <mwild1@gmail.com>
date Wed, 01 Oct 2025 18:17:13 +0100
parents 6a3b38051d74
children
line wrap: on
line diff
--- a/mod_http_admin_api/mod_http_admin_api.lua	Wed Oct 01 18:16:25 2025 +0100
+++ b/mod_http_admin_api/mod_http_admin_api.lua	Wed Oct 01 18:17:13 2025 +0100
@@ -87,7 +87,8 @@
 			if not permit then
 				return code;
 			end
-			return errors.coerce(handler(event, ...));
+			local ret, err = errors.coerce(handler(event, ...));
+			return ret or err;
 		end;
 	end
 	return routes;