code: def to_exceptions(cls, errors):
          
  
          ret = []
  
          for key, val in errors.items():
              if key in cls.relationships:
                  attr = '/data/relationships/%s' % key
              else:
                  attr = '/data/attributes/%s' % key
  
              for error in val:
                  ret.append(ValidationFailure(attr, detail=error))
  
          return ret
docs: Convert the validation errors into ValidationFailure exc's
  
          Transform native schematics validation errors into a
          goldman ValidationFailure exception.
  
          :param errors:
              dict of errors in schematics format
          :return:
              list of ValidationFailure exception objects