Matthew Wild · hg.prosody.im

Community Modules


changeset 1fc38a840baa

mod_http_admin_api: Pass util.error object as response when request fails

author
Matthew Wild
date
parents
6a3b38051d74
children
8a47791338fc
topic
files

1 files changed, 2 insertions(+), 1 deletions(-)

↓ Download patch

--- 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;

Read the original on hg.prosody.im ↗