Skip to content

RejectMessage

faststream.exceptions.RejectMessage #

RejectMessage(**kwargs)

Bases: HandlerException

Exception raised to reject a message immediately.

This exception can be used to reject a message with additional options. To watch all allowed parameters, please take a look to your broker's message.reject(**extra_options) method signature.

PARAMETER DESCRIPTION
kwargs

Additional parameters that will be passed to message.reject(**extra_options) method.

TYPE: Any DEFAULT: {}

Source code in faststream/exceptions.py
def __init__(self, **kwargs: Any):
    self.extra_options = kwargs
    super().__init__()

extra_options instance-attribute #

extra_options = kwargs