Comparison

core/moduleapi.lua @ 9750:65432dc80d90

core.moduleapi: Use convenience function for creating error object from stanza
author Kim Alvefur <zash@zash.se>
date Sun, 30 Dec 2018 20:35:20 +0100
parent 9748:99199b53019f
child 9866:09cc8c856e5e
comparison
equal deleted inserted replaced
9749:9361bd1b9c9b 9750:65432dc80d90
395 end 395 end
396 end 396 end
397 397
398 local function error_handler(event) 398 local function error_handler(event)
399 if event.stanza.attr.from == stanza.attr.to then 399 if event.stanza.attr.from == stanza.attr.to then
400 local error_type, condition, text = event.stanza:get_error(); 400 reject(errutil.from_stanza(event.stanza), event);
401 local err = errutil.new({ type = error_type, condition = condition, text = text }, event);
402 reject(err);
403 return true; 401 return true;
404 end 402 end
405 end 403 end
406 404
407 if iq_cache:get(cache_key) then 405 if iq_cache:get(cache_key) then