Rename IRCError to Error.

This commit is contained in:
Shiz 2014-02-21 19:06:13 +01:00
parent 9b4242df77
commit dedbb64267
1 changed files with 4 additions and 4 deletions

View File

@ -8,21 +8,21 @@ from . import async
from . import connection from . import connection
from . import protocol from . import protocol
__all__ = [ 'AlreadyInChannel', 'NotInChannel', 'BasicClient' ] __all__ = [ 'Error', 'AlreadyInChannel', 'NotInChannel', 'BasicClient' ]
PING_TIMEOUT = 180 PING_TIMEOUT = 180
DEFAULT_NICKNAME = '<unregistered>' DEFAULT_NICKNAME = '<unregistered>'
class IRCError(Exception): class Error(Exception):
""" Base class for all pydle errors. """ """ Base class for all pydle errors. """
pass pass
class NotInChannel(IRCError): class NotInChannel(Error):
def __init__(self, channel): def __init__(self, channel):
super().__init__('Not in channel: {}'.format(channel)) super().__init__('Not in channel: {}'.format(channel))
self.channel = channel self.channel = channel
class AlreadyInChannel(IRCError): class AlreadyInChannel(Error):
def __init__(self, channel): def __init__(self, channel):
super().__init__('Already in channel: {}'.format(channel)) super().__init__('Already in channel: {}'.format(channel))
self.channel = channel self.channel = channel