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

Method errors

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

Source from the content-addressed store, hash-verified

587
588 @property
589 def errors(self):
590 ret = super().errors
591 if isinstance(ret, list) and len(ret) == 1 and getattr(ret[0], 'code', None) == 'null':
592 # Edge case. Provide a more descriptive error than
593 # "this field may not be null", when no data is passed.
594 detail = ErrorDetail('No data provided', code='null')
595 ret = {api_settings.NON_FIELD_ERRORS_KEY: [detail]}
596 return ReturnDict(ret, serializer=self)
597
598
599# There's some replication of `ListField` here,

Callers

nothing calls this directly

Calls 2

ErrorDetailClass · 0.90
ReturnDictClass · 0.90

Tested by

no test coverage detected