Added proper exceptions for publishers

This commit is contained in:
SlyK182 2021-05-09 17:25:29 +02:00
parent 7b5b28d36f
commit 10c6b62a30
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
class PublisherError(Exception):
""" Generic publisher error """
def __init__(self, message):
""" :param str message: exception message """
super().__init__(message)
class InvalidBot(PublisherError):
""" Publisher refers to the wrong service bot """
class InvalidCredentials(PublisherError):
""" Publisher cannot validate credentials """
class InvalidEvent(PublisherError):
""" Publisher cannot validate events """
class InvalidMessage(PublisherError):
""" Publisher cannot validate message """
class InvalidResponse(PublisherError):
""" Publisher receives an invalid response from its service """