util/error.lua
changeset 11165 f51ed2652602
parent 11106 5a0ff475ecfd
child 11211 4e060ae8520b
--- a/util/error.lua	Tue Oct 13 11:59:40 2020 +0100
+++ b/util/error.lua	Thu Oct 15 13:43:03 2020 +0100
@@ -35,6 +35,7 @@
 -- What to set `type` to for stream errors or SASL errors? Those don't have a 'type' attr.
 
 local function new(e, context, registry, source)
+	if is_err(e) then return e; end
 	local template = registry and registry[e];
 	if not template then
 		if type(e) == "table" then