From 90fc893bef4caa2260793b672ad8ef29f1d7591c Mon Sep 17 00:00:00 2001 From: Max Rottenkolber Date: Fri, 10 Jun 2016 13:00:02 +0200 Subject: [PATCH] core.app: fix bug in #766 introduced while merging 6cac870a. --- src/core/app.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/app.lua b/src/core/app.lua index dbcc7f7fa9..94d08a0e23 100644 --- a/src/core/app.lua +++ b/src/core/app.lua @@ -72,20 +72,21 @@ end function with_restart (app, method) local oldshm = shm.path shm.path = app.shmpath + local status, result if use_restart then -- Run fn in protected mode using pcall. - local status, result_or_error = pcall(method, app) + status, result = pcall(method, app) -- If pcall caught an error mark app as "dead" (record time and cause -- of death). if not status then - app.dead = { error = result_or_error, time = now() } + app.dead = { error = result, time = now() } end - return status, result_or_error else - return true, method(app) + status, result = true, method(app) end shm.path = oldshm + return status, result_or_error end -- Restart dead apps.