Sha256: de758fa79f5dc1503370112c4c1852cfe0b61c5e707b50b6fff35e180714dcb5

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module CanHaveUserProvidedEntity
        module Errors
          class ProtoEntityHasNoName < ConvenientService::Error
            def initialize(proto_entity:)
              message = <<~TEXT
                Proto entity `#{proto_entity}` has no name.

                In other words:

                  proto_entity.name
                  # => nil

                NOTE: Anonymous classes do NOT have names. Are you passing an anonymous class?
              TEXT

              super(message)
            end
          end

          class ProtoEntityHasNoConcern < ConvenientService::Error
            def initialize(proto_entity:)
              message = <<~TEXT
                Proto entity `#{proto_entity}` has no concern.

                Have a look at `ConvenientService::Service::Plugins::HasResult::Entities::Result`.

                It is an example of a valid proto entity.
              TEXT

              super(message)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/common/plugins/can_have_user_provided_entity/errors.rb
convenient_service-0.10.1 lib/convenient_service/common/plugins/can_have_user_provided_entity/errors.rb
convenient_service-0.10.0 lib/convenient_service/common/plugins/can_have_user_provided_entity/errors.rb