aboutsummaryrefslogtreecommitdiffstats
path: root/util/error.lua
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
commitbcd629fbc17aab71e0ab7ce04a931626ff5b9df0 (patch)
tree5e03cbb1e12ffb689117fefca80441743fc6d967 /util/error.lua
parent7411b0a73e941b409a59d288db347efa31fc9542 (diff)
downloadprosody-bcd629fbc17aab71e0ab7ce04a931626ff5b9df0.tar.gz
prosody-bcd629fbc17aab71e0ab7ce04a931626ff5b9df0.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.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