diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-09-25 12:27:45 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-09-25 12:27:45 +0100 |
commit | 4f6f98131e29535594b8e53f97d2f9a8914ad05d (patch) | |
tree | 60b47c78046a77f10330d1717099dbc29badf143 | |
parent | 93500d02d77f1541cbe952bf3b89f2e73f2ad031 (diff) | |
download | prosody-4f6f98131e29535594b8e53f97d2f9a8914ad05d.tar.gz prosody-4f6f98131e29535594b8e53f97d2f9a8914ad05d.zip |
util.error: Minor tweaks to error creation code to prepare for future changes
-rw-r--r-- | util/error.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/util/error.lua b/util/error.lua index ade1bb3b..4079a876 100644 --- a/util/error.lua +++ b/util/error.lua @@ -42,16 +42,19 @@ local function new(e, context, registry, source) 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) |