Exception: ConvenientService::Service::Plugins::CanHaveFallbacks::Exceptions::ServiceFallbackReturnValueNotSuccess Private

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/can_have_fallbacks/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:, status:) ⇒ 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



35
36
37
38
39
40
41
42
43
44
# File 'lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb', line 35

def initialize_with_kwargs(service:, result:, status:)
  message = <<~TEXT
    Return value of service `#{service.class}`#{enclose(status, " ")}fallback is NOT a `success`.
    It is `#{result.status}`.

    Did you accidentally call `failure` or `error` instead of `success` from the `fallback#{enclose(status, "_")}result` method?
  TEXT

  initialize(message)
end