diff options
author | Kim Alvefur <zash@zash.se> | 2019-12-30 09:54:49 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-12-30 09:54:49 +0100 |
commit | adc4440fd83a3b9124f91ad38eb8aa2c933284cc (patch) | |
tree | a02413ef11e0c82cc5fa6298b7ddd7bacb579f28 /core/moduleapi.lua | |
parent | cdd6144dcc649f612c86f786c4e7fe8a12653582 (diff) | |
download | prosody-adc4440fd83a3b9124f91ad38eb8aa2c933284cc.tar.gz prosody-adc4440fd83a3b9124f91ad38eb8aa2c933284cc.zip |
core.moduleapi: Rename local name for util.error for consistency
It's called 'errors' everywhere else except here.
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r-- | core/moduleapi.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index dc1f899c..5e8438a8 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -15,7 +15,7 @@ local timer = require "util.timer"; local resolve_relative_path = require"util.paths".resolve_relative_path; local st = require "util.stanza"; local cache = require "util.cache"; -local errutil = require "util.error"; +local errors = require "util.error"; local promise = require "util.promise"; local time_now = require "util.time".now; local format = require "util.format".format; @@ -370,7 +370,7 @@ function api:send_iq(stanza, origin, timeout) local iq_cache = self._iq_cache; if not iq_cache then iq_cache = cache.new(256, function (_, iq) - iq.reject(errutil.new({ + iq.reject(errors.new({ type = "wait", condition = "resource-constraint", text = "evicted from iq tracking cache" })); @@ -398,13 +398,13 @@ function api:send_iq(stanza, origin, timeout) local function error_handler(event) if event.stanza.attr.from == stanza.attr.to then - reject(errutil.from_stanza(event.stanza, event)); + reject(errors.from_stanza(event.stanza, event)); return true; end end if iq_cache:get(cache_key) then - reject(errutil.new({ + reject(errors.new({ type = "modify", condition = "conflict", text = "IQ stanza id attribute already used", })); @@ -415,7 +415,7 @@ function api:send_iq(stanza, origin, timeout) self:hook(error_event, error_handler); local timeout_handle = self:add_timer(timeout or 120, function () - reject(errutil.new({ + reject(errors.new({ type = "wait", condition = "remote-server-timeout", text = "IQ stanza timed out", })); @@ -428,7 +428,7 @@ function api:send_iq(stanza, origin, timeout) }); if not ok then - reject(errutil.new({ + reject(errors.new({ type = "wait", condition = "internal-server-error", text = "Could not store IQ tracking data" })); |