From e3e37f77c8fbf6da74b6cea756574bb4b065cb5c Mon Sep 17 00:00:00 2001 From: BONNAURE Olivier Date: Tue, 6 Feb 2024 10:39:17 +0100 Subject: [PATCH] Fix code refactoring --- tool/net/redbean.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 6f75d04e0..a4623f96a 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -3244,7 +3244,6 @@ static bool ShouldServeCrashReportDetails(void) { static char *LuaOnHttpRequest(void) { char *error; - const char *errormessage; lua_State *L = GL; effectivepath.p = url.path.p; effectivepath.n = url.path.n; @@ -3258,7 +3257,7 @@ static char *LuaOnHttpRequest(void) { if (hasonerror) { lua_getglobal(L, "OnError"); lua_pushinteger(L, 500); - lua_pushstring(L, errormessage); + lua_pushstring(L, lua_tostring(L, -1)); if (LuaCallWithTrace(L, 2, 0, NULL) == LUA_OK) { return CommitOutput(GetLuaResponse()); } else {