Sha256: 0a5f95b3d4ee11c0e826070300fa7031c67b3534b5b29cc17215519d32adec71

Contents?: true

Size: 1.86 KB

Versions: 5

Compression:

Stored size: 1.86 KB

Contents

# frozen_string_literal: true

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

    # Should be raised when we attemp to parse incoming params but parsing fails
    #   If this error (or its descendant) is detected, we will pass the raw message
    #   into params and proceed further
    ParserError = Class.new(BaseError)

    # Raised when router receives topic name which does not correspond with any routes
    # This can only happen in a case when:
    #   - you've received a message and we cannot match it with a controller
    #   - you've changed the routing, so router can no longer associate your topic to
    #     any controller
    #   - or in a case when you do a lot of metaprogramming and you change routing/etc on runtime
    #
    # In case this happens, you will have to create a temporary route that will allow
    # you to "eat" everything from the Sidekiq queue.
    # @see https://github.com/karafka/karafka/issues/135
    NonMatchingRouteError = Class.new(BaseError)

    # Raised when we don't use or use responder not in the way it expected to based on the
    # topics usage definitions
    InvalidResponderUsage = Class.new(BaseError)

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

    # Raised when we try to use Karafka CLI commands (except install) without a bootfile
    MissingBootFile = Class.new(BaseError)

    # Raised when we want to read a persisted thread messages consumer but it is unavailable
    # This should never happen and if it does, please contact us
    MissingConsumer = Class.new(BaseError)

    # Raised when we attemp to pause a partition but the pause timeout is equal to 0
    InvalidPauseTimeout = Class.new(BaseError)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
karafka-1.1.2 lib/karafka/errors.rb
karafka-1.1.1 lib/karafka/errors.rb
karafka-1.1.0 lib/karafka/errors.rb
karafka-1.1.0.alpha2 lib/karafka/errors.rb
karafka-1.1.0.alpha1 lib/karafka/errors.rb