Update 'lib.lua'
This commit is contained in:
parent
17cdacbcc7
commit
0f1707c758
1
lib.lua
1
lib.lua
@ -27,6 +27,7 @@ local errors = {
|
|||||||
|
|
||||||
-- Converts an error into human-readable format
|
-- Converts an error into human-readable format
|
||||||
errors.format = function(e)
|
errors.format = function(e)
|
||||||
|
if type(e) == "string" then return e end
|
||||||
if not (e.type and e.type == "error" and e.data and e.error) then return "Provided error is not an error object." end
|
if not (e.type and e.type == "error" and e.data and e.error) then return "Provided error is not an error object." end
|
||||||
if e.error == errors.INTERNAL then
|
if e.error == errors.INTERNAL then
|
||||||
return "Internal error - provided info: " .. textutils.serialise(e.data) .. "."
|
return "Internal error - provided info: " .. textutils.serialise(e.data) .. "."
|
||||||
|
Loading…
Reference in New Issue
Block a user