# HG changeset patch # User Matthew Wild # Date 1601033265 -3600 # Node ID 8ea430de5fd3ad3f54a66ccb1f2032c029763401 # Parent 505c3e5907a581de1f88792c887282f376abb205 util.error: Minor tweaks to error creation code to prepare for future changes diff -r 505c3e5907a5 -r 8ea430de5fd3 util/error.lua --- a/util/error.lua Fri Sep 25 12:19:30 2020 +0100 +++ b/util/error.lua Fri Sep 25 12:27:45 2020 +0100 @@ -42,16 +42,19 @@ context.traceback = debug.traceback("error stack", 2); end - return setmetatable({ + local error_instance = setmetatable({ instance_id = id.short(); + type = template.type or "cancel"; condition = template.condition or "undefined-condition"; text = template.text; code = template.code; - context = context or template.context or { _error_id = e }; + context = context; source = source; }, error_mt); + + return error_instance; end local function init(source, registry)