From bcd629fbc17aab71e0ab7ce04a931626ff5b9df0 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 25 Sep 2020 12:38:58 +0100 Subject: util.error: Switch coerce() to use new() and change 'native' to context field 'wrapped_error' --- util/error.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/util/error.lua b/util/error.lua index 00192273..976bc355 100644 --- a/util/error.lua +++ b/util/error.lua @@ -70,12 +70,10 @@ local function coerce(ok, err, ...) return ok, err, ...; end - local new_err = setmetatable({ - native = err; + local new_err = new({ + type = "cancel", condition = "undefined-condition" + }, { wrapped_error = err }); - type = "cancel"; - condition = "undefined-condition"; - }, error_mt); return ok, new_err, ...; end -- cgit v1.2.3