diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-09-25 12:38:58 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-09-25 12:38:58 +0100 |
commit | 2595c39a8a79ea65a100709877548efeb0c1e061 (patch) | |
tree | 5e03cbb1e12ffb689117fefca80441743fc6d967 /util/error.lua | |
parent | 891a03885a2b183425f7318a89e8d91319b55681 (diff) | |
download | prosody-2595c39a8a79ea65a100709877548efeb0c1e061.tar.gz prosody-2595c39a8a79ea65a100709877548efeb0c1e061.zip |
util.error: Switch coerce() to use new() and change 'native' to context field 'wrapped_error'
Diffstat (limited to 'util/error.lua')
-rw-r--r-- | util/error.lua | 8 |
1 files 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 |