aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-25 12:38:58 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-25 12:38:58 +0100
commit2595c39a8a79ea65a100709877548efeb0c1e061 (patch)
tree5e03cbb1e12ffb689117fefca80441743fc6d967 /util
parent891a03885a2b183425f7318a89e8d91319b55681 (diff)
downloadprosody-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')
-rw-r--r--util/error.lua8
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