Skip to content

Commit

Permalink
Work in progress for twisted API
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Cline <jcline@redhat.com>
  • Loading branch information
jeremycline committed Sep 19, 2018
1 parent 2781105 commit caf7898
Show file tree
Hide file tree
Showing 4 changed files with 354 additions and 362 deletions.
25 changes: 21 additions & 4 deletions fedora_messaging/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ class BaseException(Exception):
"""The base class for all exceptions raised by fedora_messaging."""


class NoFreeChannels(BaseException):
"""Raised when a connection has reached its channel limit"""


class BadDeclaration(BaseException):
"""
Raised when declaring an object in AMQP fails.
Args:
obj_type (str): The type of object being declared. One of "binding",
"queue", or "exchange".
description (dict): The description of the object.
reason (str): The reason the server gave for rejecting the declaration.
"""

def __init__(self, obj_type, description, reason):
self.obj_type = obj_type
self.description = description
self.reason = reason


class ConfigurationException(BaseException):
"""
Raised when there's an invalid configuration setting
Expand Down Expand Up @@ -69,10 +90,6 @@ class Drop(ConsumeException):
"""


class BadConsumer(ConsumeException):
"""Raised when the consumer specified does not exist."""


class HaltConsumer(ConsumeException):
"""
Consumer callbacks should raise this exception if they wish the consumer to
Expand Down
Loading

0 comments on commit caf7898

Please sign in to comment.