def raise_invalid(request, location='body', name=None, description=None, **kwargs):
 request.errors.add(location, name, description, **kwargs)
 response = json_error_handler(request)
 raise response

def raise_invalid ( request , location = 'body' , name = None , description = None , ** kwargs ) : request . errors . add ( location , name , description , ** kwargs ) response = json_error_handler ( request ) raise response
helper to raise a validation error .