Sha256: e1a654b1e69db0e721022ccfcfaa5886f65c3577cf261b30bb71717fc259c160

Contents?: true

Size: 1.07 KB

Versions: 64

Compression:

Stored size: 1.07 KB

Contents

# This file contains all the error classes for this gem.
module DispatchRider
  # The base error class of the gem
  class DispatchRiderError < StandardError
  end

  # The error class for objects not being found
  class NotFound < DispatchRiderError
    def initialize(name)
      super("#{name.to_s} could not be found")
    end
  end

  # The error class for keys not registered in a registrar
  class NotRegistered < DispatchRiderError
    def initialize(name)
      super("#{name.to_s} has not been registered")
    end
  end

  # This error is raised when a queue service depends on an external library, but that is not present
  class AdapterNotFoundError < DispatchRiderError
    def initialize(lib_name, gem_name)
      super("Constant #{lib_name} wasn't found. Please install the #{gem_name} gem")
    end
  end

  # This error is raised when validation fails on an object
  class RecordInvalid < DispatchRiderError
    def initialize(object, error_messages)
      super("#{object.class.name} is not valid because of the following errors : #{error_messages.to_sentence}")
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
dispatch-rider-2.1.0 lib/dispatch-rider/errors.rb
dispatch-rider-2.0.0 lib/dispatch-rider/errors.rb
dispatch-rider-1.9.0 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.6 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.5 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.4 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.3 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.2 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.1 lib/dispatch-rider/errors.rb
dispatch-rider-1.8.0 lib/dispatch-rider/errors.rb
dispatch-rider-1.7.2 lib/dispatch-rider/errors.rb
dispatch-rider-1.7.1 lib/dispatch-rider/errors.rb
dispatch-rider-1.7.0 lib/dispatch-rider/errors.rb
dispatch-rider-1.6.2 lib/dispatch-rider/errors.rb
dispatch-rider-1.6.1 lib/dispatch-rider/errors.rb
dispatch-rider-1.6.0 lib/dispatch-rider/errors.rb
dispatch-rider-1.5.3 lib/dispatch-rider/errors.rb
dispatch-rider-1.5.2 lib/dispatch-rider/errors.rb
dispatch-rider-1.5.1 lib/dispatch-rider/errors.rb
dispatch-rider-1.5.0 lib/dispatch-rider/errors.rb