class Contentful::Management::UnprocessableEntity

422

Protected Instance Methods

default_error_message() click to toggle source
# File lib/contentful/management/error.rb, line 158
def default_error_message
  'The resource you sent in the body is invalid.'
end
handle_details(details) click to toggle source
# File lib/contentful/management/error.rb, line 170
def handle_details(details)
  errors = []
  details['errors'].each do |error|
    errors << handle_error(error)
  end

  "\n#{errors.join("\n")}"
end
handle_error(error) click to toggle source
# File lib/contentful/management/error.rb, line 162
def handle_error(error)
  name = error['name']
  path = error['path']
  value = error['value']

  "\t* Name: #{name} - Path: '#{path}' - Value: '#{value}'"
end