# HG changeset patch # User Matthew Wild # Date 1601033563 -3600 # Node ID fb3aec3dbe212744df7af21f933fc5cba9536906 # Parent 8ea430de5fd3ad3f54a66ccb1f2032c029763401 util.error: Have init() return an object to allow API extensibility via additional methods diff -r 8ea430de5fd3 -r fb3aec3dbe21 util/error.lua --- 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, ...)