Sha256: 67944e3d05ac1b8eae298103d970ec5598870fb77ba998fdf4fbb378e357f13e

Contents?: true

Size: 1.64 KB

Versions: 26

Compression:

Stored size: 1.64 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 during messages flushing something bad happened
    class FlushFailureError < BaseError
      attr_reader :dispatched_messages

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
waterdrop-2.4.11 lib/waterdrop/errors.rb
waterdrop-2.4.10 lib/waterdrop/errors.rb
waterdrop-2.4.9 lib/waterdrop/errors.rb
waterdrop-2.4.8 lib/waterdrop/errors.rb
waterdrop-2.4.7 lib/waterdrop/errors.rb
waterdrop-2.4.6 lib/waterdrop/errors.rb
waterdrop-2.4.5 lib/waterdrop/errors.rb
waterdrop-2.4.4 lib/waterdrop/errors.rb
waterdrop-2.4.3 lib/waterdrop/errors.rb
waterdrop-2.4.2 lib/waterdrop/errors.rb
waterdrop-2.4.1 lib/waterdrop/errors.rb
waterdrop-2.4.0 lib/waterdrop/errors.rb
waterdrop-2.3.3 lib/waterdrop/errors.rb
waterdrop-2.3.2 lib/waterdrop/errors.rb
waterdrop-2.3.1 lib/waterdrop/errors.rb
waterdrop-2.3.0 lib/waterdrop/errors.rb
waterdrop-2.2.0 lib/waterdrop/errors.rb
waterdrop-2.1.0 lib/water_drop/errors.rb
waterdrop-2.0.7 lib/water_drop/errors.rb
waterdrop-2.0.6 lib/water_drop/errors.rb