Sha256: c5f3735c4e87e1a50da1c11bd33bf7d7566b6bf62494eae8be1e5180a16d11d2

Contents?: true

Size: 681 Bytes

Versions: 4

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module RaisesOnNotResultReturnValue
        module Exceptions
          class ReturnValueNotKindOfResult < ::ConvenientService::Exception
            def initialize_with_kwargs(service:, result:, method:)
              message = <<~TEXT
                Return value of service `#{service.class}` is NOT a `Result`.
                It is `#{result.class}`.

                Did you forget to call `success`, `failure`, or `error` from the `:#{method}` method?
              TEXT

              initialize(message)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb
convenient_service-0.19.0 lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb
convenient_service-0.18.0 lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb
convenient_service-0.17.0 lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb