From beda43b240a53718a4d1d5130572f2823ae7f175 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 26 May 2018 11:02:03 +0100 Subject: [PATCH] Added exceptions to error call when not a string --- control.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/control.lua b/control.lua index e831cefe..ab9e083f 100644 --- a/control.lua +++ b/control.lua @@ -11,6 +11,9 @@ 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')