MCPcopy Index your code
hub / github.com/encode/django-rest-framework / errors

Method errors

rest_framework/serializers.py:813–822  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

811
812 @property
813 def errors(self):
814 ret = super().errors
815 if isinstance(ret, list) and len(ret) == 1 and getattr(ret[0], 'code', None) == 'null':
816 # Edge case. Provide a more descriptive error than
817 # "this field may not be null", when no data is passed.
818 detail = ErrorDetail('No data provided', code='null')
819 ret = {api_settings.NON_FIELD_ERRORS_KEY: [detail]}
820 if isinstance(ret, dict):
821 return ReturnDict(ret, serializer=self)
822 return ReturnList(ret, serializer=self)
823
824
825# ModelSerializer & HyperlinkedModelSerializer

Callers

nothing calls this directly

Calls 3

ErrorDetailClass · 0.90
ReturnDictClass · 0.90
ReturnListClass · 0.90

Tested by

no test coverage detected