mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Later: Do not use ValueError for reporting full queues.
Someone on IRC reported a ValueError being raised from an other part of the code.
This commit is contained in:
parent
ce0b788f2f
commit
e9b122c973
@ -42,6 +42,9 @@ import supybot.callbacks as callbacks
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Later')
|
||||
|
||||
class QueueIsFull(Exception):
|
||||
pass
|
||||
|
||||
class Later(callbacks.Plugin):
|
||||
"""Used to do things later; currently, it only allows the sending of
|
||||
nick-based notes. Do note (haha!) that these notes are *not* private
|
||||
@ -93,7 +96,7 @@ class Later(callbacks.Plugin):
|
||||
try:
|
||||
notes = self._notes[nick]
|
||||
if maximum and len(notes) >= maximum:
|
||||
raise ValueError
|
||||
raise QueueIsFull()
|
||||
else:
|
||||
notes.append((at, whence, text))
|
||||
except KeyError:
|
||||
@ -170,7 +173,7 @@ class Later(callbacks.Plugin):
|
||||
for validnick in validnicks:
|
||||
try:
|
||||
self._addNote(validnick, msg.nick, text)
|
||||
except ValueError:
|
||||
except QueueIsFull:
|
||||
full_queues.append(validnick)
|
||||
if full_queues:
|
||||
irc.error(format(
|
||||
|
Loading…
Reference in New Issue
Block a user