Sha256: f6feac2f6261e896acd86b2d75e07132ae90f08d80ff94b8b2f49fbf78365257

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module CanHaveUserProvidedEntity
        module Exceptions
          class ProtoEntityHasNoName < ::ConvenientService::Exception
            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::Exception
            def initialize(proto_entity:)
              message = <<~TEXT
                Proto entity `#{proto_entity}` has no concern.

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

                It is an example of a valid proto entity.
              TEXT

              super(message)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.16.0 lib/convenient_service/common/plugins/can_have_user_provided_entity/exceptions.rb
convenient_service-0.15.0 lib/convenient_service/common/plugins/can_have_user_provided_entity/exceptions.rb
convenient_service-0.14.0 lib/convenient_service/common/plugins/can_have_user_provided_entity/exceptions.rb
convenient_service-0.13.0 lib/convenient_service/common/plugins/can_have_user_provided_entity/exceptions.rb