Class: ConvenientService::Service::Plugins::RaisesOnNotResultReturnValue::Middleware

Inherits:
MethodChainMiddleware
  • Object
show all
Includes:
ConvenientService::Support::DependencyContainer::Import
Defined in:
lib/convenient_service/service/plugins/raises_on_not_result_return_value/middleware.rb

Instance Method Summary collapse

Methods included from ConvenientService::Support::Concern

included

Instance Method Details

#nextObject



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

def next(...)
  original_result = chain.next(...)

  return original_result if commands.is_result?(original_result)

  ::ConvenientService.raise Exceptions::ReturnValueNotKindOfResult.new(service: entity, result: original_result, method: method)
end