# HG changeset patch # User Kim Alvefur # Date 1546198520 -3600 # Node ID 65432dc80d9021d05fdd5878eccd64ab00935dbf # Parent 9361bd1b9c9b99a50929648ffb8277b7381d0ac4 core.moduleapi: Use convenience function for creating error object from stanza diff -r 9361bd1b9c9b -r 65432dc80d90 core/moduleapi.lua --- 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