MCPcopy
hub / github.com/hugapi/hug / render_errors

Method render_errors

hug/interface.py:814–830  ·  view source on GitHub ↗
(self, errors, request, response)

Source from the content-addressed store, hash-verified

812 response.content_type = self.content_type(request, response)
813
814 def render_errors(self, errors, request, response):
815 data = {"errors": errors}
816 if getattr(self, "on_invalid", False):
817 data = self.on_invalid(
818 data, **self._arguments(self._params_for_on_invalid, request, response)
819 )
820
821 response.status = HTTP_BAD_REQUEST
822 if getattr(self, "invalid_outputs", False):
823 response.content_type = self.invalid_content_type(request, response)
824 response.data = self.invalid_outputs(
825 data, **self._arguments(self._params_for_invalid_outputs, request, response)
826 )
827 else:
828 response.data = self.outputs(
829 data, **self._arguments(self._params_for_outputs, request, response)
830 )
831
832 def call_function(self, parameters):
833 if not self.interface.takes_kwargs:

Callers 2

__call__Method · 0.95
requestMethod · 0.80

Calls 4

_argumentsMethod · 0.95
invalid_content_typeMethod · 0.95
outputsMethod · 0.95
on_invalidMethod · 0.80

Tested by

no test coverage detected