diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-10-15 13:43:03 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-10-15 13:43:03 +0100 |
commit | bbc78f6e851990df4975bea177f182069cd6d7fa (patch) | |
tree | d1485817f74c418b483df72cad43a56685d88c0b /util | |
parent | ea9edcb9e0ecf62bf56537c3c3f7501c748a0174 (diff) | |
download | prosody-bbc78f6e851990df4975bea177f182069cd6d7fa.tar.gz prosody-bbc78f6e851990df4975bea177f182069cd6d7fa.zip |
util.error: Pass through existing error objects passed to new()
Diffstat (limited to 'util')
-rw-r--r-- | util/error.lua | 1 |
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 |