Add error handling to exec command and fix minor bug in cleaning up relays
This commit is contained in:
parent
872d08be3e
commit
89894287b3
|
@ -7,7 +7,12 @@ class ExecCommand:
|
||||||
def exec(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
def exec(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||||
if authed:
|
if authed:
|
||||||
if length > 1:
|
if length > 1:
|
||||||
info(str(exec(" ".join(spl[1:]))))
|
try:
|
||||||
|
rtrn = exec(" ".join(spl[1:]))
|
||||||
|
except Exception as err:
|
||||||
|
failure(str(err))
|
||||||
|
return
|
||||||
|
info(str(rtrn))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
incUsage("exec")
|
incUsage("exec")
|
||||||
|
|
|
@ -223,6 +223,8 @@ class IRCBot(IRCClient):
|
||||||
self.setNick(self._attemptedNick)
|
self.setNick(self._attemptedNick)
|
||||||
|
|
||||||
def irc_ERR_PASSWDMISMATCH(self, prefix, params):
|
def irc_ERR_PASSWDMISMATCH(self, prefix, params):
|
||||||
|
print(locals())
|
||||||
|
print(globals())
|
||||||
log("%s: password mismatch" % self.name)
|
log("%s: password mismatch" % self.name)
|
||||||
sendAll("%s: password mismatch" % self.name)
|
sendAll("%s: password mismatch" % self.name)
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Network:
|
||||||
|
|
||||||
def seppuku(self):
|
def seppuku(self):
|
||||||
# Removes all bots in preperation for deletion
|
# Removes all bots in preperation for deletion
|
||||||
self.killAliases(self.relay.keys())
|
self.killAliases(self.relays.keys())
|
||||||
|
|
||||||
def start_bot(self, num):
|
def start_bot(self, num):
|
||||||
# a single name is given to relays in the backend
|
# a single name is given to relays in the backend
|
||||||
|
|
Loading…
Reference in New Issue