Changeset

11053:04ad9555c799

util.error: Add a 'source' parameter where origin module can be mentioned
author Kim Alvefur <zash@zash.se>
date Fri, 28 Aug 2020 13:54:16 +0200
parents 11052:1f42b08b134f
children 11054:ad07152d7bde
files util/error.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/error.lua	Fri Aug 28 12:54:31 2020 +0100
+++ b/util/error.lua	Fri Aug 28 13:54:16 2020 +0200
@@ -33,7 +33,7 @@
 -- 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 @@
 		code = template.code;
 
 		context = context or template.context or { _error_id = e };
+		source = source;
 	}, error_mt);
 end