Module: Excom::Plugins::Errors

Defined in:
lib/excom/plugins/errors.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.used(service_class) ⇒ Object



6
7
8
# File 'lib/excom/plugins/errors.rb', line 6

def self.used(service_class, *)
  service_class.add_execution_prop(:errors)
end

Instance Method Details

#errorsObject



25
26
27
# File 'lib/excom/plugins/errors.rb', line 25

def errors
  state.errors
end

#executeObject



10
11
12
13
14
15
16
17
18
# File 'lib/excom/plugins/errors.rb', line 10

def execute(*)
  super

  if self.class.plugins[:errors].options[:fail_if_present] && !errors.empty?
    failure!
  end

  self
end