From a86787509e6fc477cae1af1ac6bc3aff22ed88a8 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 26 May 2018 11:38:35 +0100 Subject: [PATCH 1/2] Fixed Error Handdle forgot the pcall --- control.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/control.lua b/control.lua index ab9e083f..c0421ef2 100644 --- a/control.lua +++ b/control.lua @@ -11,13 +11,10 @@ Discord: https://discord.gg/r6dC2uK -- Replaces the base error function _error = error error = function(err) - if type(err) == 'table' then err = serpent.line(err) -- used factorio build in to avoid more errors - elseif type(err) ~= 'number' and type(err) ~= 'string' then err = tostring(err) - end verbose('Error Called: '..err) if _G.error_handle and type(error_handle) == 'function' then verbose('Exception Caught By Error Handle') - local success, _err = error_handle(err) + local success, _err = pcall(error_handle,err) if not success then _error({handle=_err,err=err}) end elseif _G.Game and game then verbose('Exception Caught By Game Print') @@ -30,7 +27,7 @@ error = function(err) end end -- Replaces the base require function and verbose function -_verbose = false -- Set to true for more on the loading of the files +_verbose = true -- Set to true for more on the loading of the files function verbose(str) if _verbose then log(str) print(str) end end verbose('============================= START =============================') require_return_err = false -- Set to false when removing files; set to true for debuging From 15b6c91d0b7cd68be84f12df473113165c38a280 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 26 May 2018 11:42:21 +0100 Subject: [PATCH 2/2] Disabled verbose --- control.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control.lua b/control.lua index c0421ef2..90226fbb 100644 --- a/control.lua +++ b/control.lua @@ -27,7 +27,7 @@ error = function(err) end end -- Replaces the base require function and verbose function -_verbose = true -- Set to true for more on the loading of the files +_verbose = false -- Set to true for more on the loading of the files function verbose(str) if _verbose then log(str) print(str) end end verbose('============================= START =============================') require_return_err = false -- Set to false when removing files; set to true for debuging