Module: Eco::API::UseCases::GraphQL::Helpers::Pages::Rescuable

Included in:
Samples::Pages::Register::Base
Defined in:
lib/eco/api/usecases/graphql/helpers/pages/rescuable.rb

Overview

Prevents a script from stopping on a per-item error, prompting the operator to continue or abort. Ported from OozeSamples::Helpers::Rescuable; the only change is the base-type guard, which now requires a native GraphQL::Base case.

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.validate_base_type!(base) ⇒ Object

Raises:

  • (LoadError)


40
41
42
43
44
45
46
47
48
# File 'lib/eco/api/usecases/graphql/helpers/pages/rescuable.rb', line 40

def validate_base_type!(base)
  return super if defined?(super)

  msg  = "#{self} can only be included in Eco::API::UseCases::GraphQL::Base"
  msg << "\nCan't be included in #{base}"
  raise LoadError, msg unless base <= Eco::API::UseCases::GraphQL::Base

  true
end