mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 02:49:27 +01:00
LogToIrc: better error handling
This commit is contained in:
parent
f0b4332908
commit
7359ddce90
@ -1,5 +1,6 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2004, Stéphan Kochen
|
# Copyright (c) 2004, Stéphan Kochen
|
||||||
|
# Copyright (c) 2021, Valentin Lorentz
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -57,11 +58,14 @@ class IrcHandler(logging.Handler):
|
|||||||
msgmaker = ircmsgs.notice
|
msgmaker = ircmsgs.notice
|
||||||
msg = msgmaker(target, s)
|
msg = msgmaker(target, s)
|
||||||
for irc in world.ircs:
|
for irc in world.ircs:
|
||||||
|
if irc.driver is None:
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
if not irc.driver.connected:
|
if not irc.driver.connected:
|
||||||
continue
|
continue
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
print('*** AttributeError, shouldn\'t happen: %s' % e)
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
continue
|
continue
|
||||||
networks = conf.supybot.plugins.LogToIrc.networks()
|
networks = conf.supybot.plugins.LogToIrc.networks()
|
||||||
if networks and irc.network not in networks:
|
if networks and irc.network not in networks:
|
||||||
|
Loading…
Reference in New Issue
Block a user