# HG changeset patch # User Matthew Wild # Date 1602765783 -3600 # Node ID f51ed2652602ec2908c203243b48d44e6d4d9460 # Parent e9eeaefa09a78d965e22270c393f78ff6ef1cf2c util.error: Pass through existing error objects passed to new() diff -r e9eeaefa09a7 -r f51ed2652602 util/error.lua --- 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