From 58e33e399553ccc457de266c36102308f63bfe02 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 15 Oct 2020 13:43:03 +0100 Subject: util.error: Pass through existing error objects passed to new() --- util/error.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'util/error.lua') diff --git a/util/error.lua b/util/error.lua index 132389f7..85265e47 100644 --- a/util/error.lua +++ b/util/error.lua @@ -35,6 +35,7 @@ end -- 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 -- cgit v1.2.3