Sha256: db8cd8b2b05ae8ed9aa95c6d8c92fa2226e6d343e164cab1a02d7b3891cb117f

Contents?: true

Size: 1.73 KB

Versions: 9

Compression:

Stored size: 1.73 KB

Contents

# frozen_string_literal: true

module WaterDrop
  # Namespace used to encapsulate all the internal errors of WaterDrop
  module Errors
    # Base class for all the WaterDrop internal errors
    BaseError = Class.new(StandardError)

    # Raised when configuration doesn't match with validation contract
    ConfigurationInvalidError = Class.new(BaseError)

    # Raised when we want to use a producer that was not configured
    ProducerNotConfiguredError = Class.new(BaseError)

    # Raised when we want to reconfigure a producer that was already configured
    ProducerAlreadyConfiguredError = Class.new(BaseError)

    # Raised when trying to use connected producer from a forked child process
    # Producers cannot be used in forks if they were already used in the child processes
    ProducerUsedInParentProcess = Class.new(BaseError)

    # Raised when there was an attempt to use a closed producer
    ProducerClosedError = Class.new(BaseError)

    # Raised when we want to send a message that is invalid (impossible topic, etc)
    MessageInvalidError = Class.new(BaseError)

    # Raised when we've got an unexpected status. This should never happen. If it does, please
    # contact us as it is an error.
    StatusInvalidError = Class.new(BaseError)

    # Raised when there is an inline error during single message produce operations
    ProduceError = Class.new(BaseError)

    # Raised when during messages producing something bad happened inline
    class ProduceManyError < ProduceError
      attr_reader :dispatched

      # @param dispatched [Array<Rdkafka::Producer::DeliveryHandle>] handlers of the
      #   messages that we've dispatched
      def initialize(dispatched)
        super()
        @dispatched = dispatched
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
waterdrop-2.6.3 lib/waterdrop/errors.rb
waterdrop-2.6.2 lib/waterdrop/errors.rb
waterdrop-2.6.1 lib/waterdrop/errors.rb
waterdrop-2.6.1.beta1 lib/waterdrop/errors.rb
waterdrop-2.6.0 lib/waterdrop/errors.rb
waterdrop-2.5.3 lib/waterdrop/errors.rb
waterdrop-2.5.2 lib/waterdrop/errors.rb
waterdrop-2.5.1 lib/waterdrop/errors.rb
waterdrop-2.5.0 lib/waterdrop/errors.rb