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

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



14
15
16
17
18
19
20
21
22
23
# File 'lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb', line 14

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