

def render_errors(self, errors, request, response):
    data = {
        'errors': errors,
    }
    if getattr(self, 'on_invalid', False):
        data = self.on_invalid(data, **self._arguments(self._params_for_on_invalid, request, response))
    response.status = HTTP_BAD_REQUEST
    if getattr(self, 'invalid_outputs', False):
        response.content_type = self.invalid_content_type(request, response)
        response.data = self.invalid_outputs(data, **self._arguments(self._params_for_invalid_outputs, request, response))
    else:
        response.data = self.outputs(data, **self._arguments(self._params_for_outputs, request, response))

dataset/ETHPy150Open timothycrosley/hug/hug/interface.py HTTP.render_errors/original