# HG changeset patch # User Kim Alvefur # Date 1557444566 -7200 # Node ID 73a8192058f9796db23404d993919781513dd99e # Parent 598befab492e07ede3273b75d9f93ca50fd82bbc mod_admin_telnet: Move error handling to thread callback (fixes #1391) Avoids yielding over pcall boundry, fixes xmpp:ping() command on Lua 5.1 diff -r 598befab492e -r 73a8192058f9 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Fri May 10 01:28:09 2019 +0200 +++ b/plugins/mod_admin_telnet.lua Fri May 10 01:29:26 2019 +0200 @@ -62,6 +62,9 @@ function runner_callbacks:error(err) module:log("error", "Traceback[telnet]: %s", err); + + self.data.print("Fatal error while running command, it did not complete"); + self.data.print("Error: "..tostring(err)); end @@ -133,13 +136,7 @@ end end - local ranok, taskok, message = pcall(chunk); - - if not ranok then - session.print("Fatal error while running command, it did not complete"); - session.print("Error: "..taskok); - return; - end + local taskok, message = chunk(); if not message then session.print("Result: "..tostring(taskok));