Software /
code /
prosody
Diff
util/error.lua @ 11078:fb3aec3dbe21
util.error: Have init() return an object to allow API extensibility via additional methods
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 25 Sep 2020 12:32:43 +0100 |
parent | 11077:8ea430de5fd3 |
child | 11079:1e5a0e0469de |
line wrap: on
line diff
--- a/util/error.lua Fri Sep 25 12:27:45 2020 +0100 +++ b/util/error.lua Fri Sep 25 12:32:43 2020 +0100 @@ -58,9 +58,11 @@ end local function init(source, registry) - return function (e, context) - return new(e, context, registry, source); - end + return { + new = function (e, context) + return new(e, context, registry, source); + end; + }; end local function coerce(ok, err, ...)