aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-10-15 13:43:03 +0100
committerMatthew Wild <mwild1@gmail.com>2020-10-15 13:43:03 +0100
commit58e33e399553ccc457de266c36102308f63bfe02 (patch)
treed1485817f74c418b483df72cad43a56685d88c0b
parent7672305919887537f04441deaf51e68def696f79 (diff)
downloadprosody-58e33e399553ccc457de266c36102308f63bfe02.tar.gz
prosody-58e33e399553ccc457de266c36102308f63bfe02.zip
util.error: Pass through existing error objects passed to new()
-rw-r--r--util/error.lua1
1 files changed, 1 insertions, 0 deletions
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