# Class RabbitConsumerErrorHandler

Namespace
  adas_core.Infrastructure.Utils

Assembly
  adas-core.Infrastructure.dll

Handles errors that occur during RabbitMQ message consumption and publishes them using the configured publisher service.

    public class RabbitConsumerErrorHandler

Inheritance
  object
  RabbitConsumerErrorHandler

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Constructors

### RabbitConsumerErrorHandler(IPublisherService)

Handles errors that occur during RabbitMQ message consumption and publishes them using the configured publisher service.

    public RabbitConsumerErrorHandler(IPublisherService publisherService)

#### Parameters

`publisherService` IPublisherService

## Methods

### HandleAsync<T>(Message<T>, MessageReceivedInfo, Func<Task>)

Processes a received message by invoking the next handler in the pipeline, and on failure logs the error, serializes the message body to a string, and delegates to the retry handler using the message properties, received info, and the captured exception.

    public Task HandleAsync<T>(Message<T> message, MessageReceivedInfo receivedInfo, Func<Task> next)

#### Parameters

`message` Message<T>

  The deserialized message whose body is inspected or re-serialized for retry handling.

`receivedInfo` MessageReceivedInfo

  Information about the message receipt, passed to the retry handler.

`next` Func<Task>

  The asynchronous delegate representing the next step in the processing pipeline.

#### Returns

Task

#### Type Parameters

`T`