lib/apia/environment_error_handling.rb
# Return an error instance for a given exception class
#
# @param exception_class [Class] any error class
# @return [Class, nil] any class that inherits from Apia::Error or nil if no error is found
Return an error instance for a given exception class
Return an error instance for a given exception class
def error_for_exception(exception_class)
      potential_error_sources.each do |source|
        source.definition.potential_errors.each do |error|
          if error.definition.catchable_exceptions.key?(exception_class)
            return {
              error: error,
              block: error.definition.catchable_exceptions[exception_class]
            }
          end
        end
      end
      nil
    end
def error_for_exception ( exception_class ) potential_error_sources . each do | source | source . definition . potential_errors . each do | error | if error . definition . catchable_exceptions . key? ( exception_class ) return { error : error , block : error . definition . catchable_exceptions [ exception_class ] } end end end nil end
Return an error instance for a given exception class
Return an error instance for a given exception class
any class that inherits from Apia::Error or nil if no error is found
any class that inherits from Apia :: Error or nil if no error is found
Class, nil
exception_class
any error class
any error class