aboutsummaryrefslogtreecommitdiffstats
path: root/util/error.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-25 12:32:43 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-25 12:32:43 +0100
commit891a03885a2b183425f7318a89e8d91319b55681 (patch)
tree735c1de9e29c2602dca28e8cbf16879474d9752f /util/error.lua
parent9c709d29fd4e37aeb41a9959889347e8d579273b (diff)
downloadprosody-891a03885a2b183425f7318a89e8d91319b55681.tar.gz
prosody-891a03885a2b183425f7318a89e8d91319b55681.zip
util.error: Have init() return an object to allow API extensibility via additional methods
Diffstat (limited to 'util/error.lua')
-rw-r--r--util/error.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/error.lua b/util/error.lua
index 4079a876..00192273 100644
--- a/util/error.lua
+++ b/util/error.lua
@@ -58,9 +58,11 @@ local function new(e, context, registry, source)
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, ...)