From 891a03885a2b183425f7318a89e8d91319b55681 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 25 Sep 2020 12:32:43 +0100 Subject: util.error: Have init() return an object to allow API extensibility via additional methods --- util/error.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'util/error.lua') 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, ...) -- cgit v1.2.3