From 7411b0a73e941b409a59d288db347efa31fc9542 Mon Sep 17 00:00:00 2001
From: Matthew Wild <mwild1@gmail.com>
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(-)

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