aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-28 13:54:16 +0200
committerKim Alvefur <zash@zash.se>2020-08-28 13:54:16 +0200
commit7e563605c92e6b7ee609c33b622a1ca86b6956c4 (patch)
treee01e3fd7b84c8d06ba37f6fd87338be314700691 /util
parent2a9cdf2538d3fc11685f65e2d137f5e10e511f8d (diff)
downloadprosody-7e563605c92e6b7ee609c33b622a1ca86b6956c4.tar.gz
prosody-7e563605c92e6b7ee609c33b622a1ca86b6956c4.zip
util.error: Add a 'source' parameter where origin module can be mentioned
Diffstat (limited to 'util')
-rw-r--r--util/error.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/error.lua b/util/error.lua
index ffdc4eec..600c9e5e 100644
--- a/util/error.lua
+++ b/util/error.lua
@@ -33,7 +33,7 @@ end
-- Should the `type` be restricted to the stanza error types or free-form?
-- What to set `type` to for stream errors or SASL errors? Those don't have a 'type' attr.
-local function new(e, context, registry)
+local function new(e, context, registry, source)
local template = (registry and registry[e]) or e or {};
context = context or template.context or { _error_id = e };
@@ -48,6 +48,7 @@ local function new(e, context, registry)
code = template.code;
context = context or template.context or { _error_id = e };
+ source = source;
}, error_mt);
end