def validate_field(field, params)
      begin
        value = params.fetch(field)
        required_error(field) if value.nil? || value.empty?
      rescue KeyError
        required_error(field)
      end
    end
def validate_field(field, params)
      begin
        value = params.fetch(field)
        required_error(field) if value.nil? || value.empty?
      rescue KeyError
        required_error(field)
      end
    end
TODO (kayagoban) A validator accepting a block for conditional execution
 might be useful.
 Maybe require_keys should accept a block.  Figure out later.