Exception: ConvenientService::Service::Plugins::RaisesOnNotResultReturnValue::Exceptions::ReturnValueNotKindOfResult

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(service:, result:, method:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb', line 9

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