Changeset

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
parents 9749:9361bd1b9c9b
children 9751:39ee70fbb009
files core/moduleapi.lua
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core/moduleapi.lua	Sun Dec 30 20:30:59 2018 +0100
+++ b/core/moduleapi.lua	Sun Dec 30 20:35:20 2018 +0100
@@ -397,9 +397,7 @@
 
 		local function error_handler(event)
 			if event.stanza.attr.from == stanza.attr.to then
-				local error_type, condition, text = event.stanza:get_error();
-				local err = errutil.new({ type = error_type, condition = condition, text = text }, event);
-				reject(err);
+				reject(errutil.from_stanza(event.stanza), event);
 				return true;
 			end
 		end