Class: Eco::API::Custom::ErrorHandler

Overview

Helper class to create a custom ErrorHandler

Examples:

Example of usage:

class Custom::ErrorHandler::EmailTaken < Eco::API::Custom::ErrorHandler
  error Eco::API::Error::EmailTaken

  def main(people, session, options, handler, job)
    people.each do |person|
      prev_email = person.initial_doc["email"]
      if person.email != prev_email
        person.email = prev_email
      else
        person. = nil
      end
      job.add(person)
    end
  end
end

Instance Attribute Summary

Attributes included from Language::AuxiliarLogger

#logger

Method Summary

Methods inherited from Eco::API::Common::Loaders::ErrorHandler

#error, #initialize, #main

Methods inherited from Eco::API::Common::Loaders::CaseBase

#name, name_only_once!

Methods inherited from Eco::API::Common::Loaders::Base

<=>, created_at, #initialize, set_created_at!

Methods included from Eco::API::Common::ClassHelpers

#class_resolver, #descendants, #descendants?, #inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant

Methods included from Language::AuxiliarLogger

#log

Constructor Details

This class inherits a constructor from Eco::API::Common::Loaders::ErrorHandler