aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/http/server.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/http/server.lua b/net/http/server.lua
index 47f064a5..f4f67d18 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -191,7 +191,7 @@ local function handle_result(request, response, result)
elseif result_type == "string" then
body = result;
elseif errors.is_err(result) then
- body = events.fire_event("http-error", { request = request, response = response, code = result.code, error = result });
+ body = events.fire_event("http-error", { request = request, response = response, code = result.code or 500, error = result });
elseif promise.is_promise(result) then
result:next(function (ret)
handle_result(request, response, ret);