aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commit7411b0a73e941b409a59d288db347efa31fc9542 (patch)
tree735c1de9e29c2602dca28e8cbf16879474d9752f /util
parent4f6f98131e29535594b8e53f97d2f9a8914ad05d (diff)
downloadprosody-7411b0a73e941b409a59d288db347efa31fc9542.tar.gz
prosody-7411b0a73e941b409a59d288db347efa31fc9542.zip
util.error: Have init() return an object to allow API extensibility via additional methods
Diffstat (limited to 'util')
-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, ...)