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

Method __init__

rest_framework/exceptions.py:148–161  ·  view source on GitHub ↗
(self, detail=None, code=None)

Source from the content-addressed store, hash-verified

146 default_code = 'invalid'
147
148 def __init__(self, detail=None, code=None):
149 if detail is None:
150 detail = self.default_detail
151 if code is None:
152 code = self.default_code
153
154 # For validation failures, we may collect many errors together,
155 # so the details should always be coerced to a list if not already.
156 if isinstance(detail, tuple):
157 detail = list(detail)
158 elif not isinstance(detail, dict) and not isinstance(detail, list):
159 detail = [detail]
160
161 self.detail = _get_error_details(detail, code)
162
163
164class ParseError(APIException):

Callers

nothing calls this directly

Calls 1

_get_error_detailsFunction · 0.85

Tested by

no test coverage detected