diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-11-23 20:38:51 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-11-23 20:38:51 +0000 |
commit | 6d9006436eda1934c307b9688607c455b6a5054c (patch) | |
tree | 8f85328770526fa5eba8a5c1f43ce769cefba458 | |
parent | 7a1c57ac6b8d4c3631265c1ea7a4995a849d54f2 (diff) | |
download | prosody-6d9006436eda1934c307b9688607c455b6a5054c.tar.gz prosody-6d9006436eda1934c307b9688607c455b6a5054c.zip |
util.promise: Use xpcall() for promise function to preserve tracebacks
-rw-r--r-- | util/promise.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/promise.lua b/util/promise.lua index 07c9c4dc..75c8697b 100644 --- a/util/promise.lua +++ b/util/promise.lua @@ -78,7 +78,7 @@ local function new(f) local p = setmetatable({ _state = "pending", _next = next_pending, _pending_on_fulfilled = {}, _pending_on_rejected = {} }, promise_mt); if f then local resolve, reject = new_resolve_functions(p); - local ok, ret = pcall(f, resolve, reject); + local ok, ret = xpcall(f, debug.traceback, resolve, reject); if not ok and p._state == "pending" then reject(ret); end |