blob: 714f513e47abafec5f26b75c7b6dffb3e803b3f5 [file] [log] [blame]
Mitja Nikolause9208082018-07-30 14:22:09 +02001"""Response descriptions for HTTP responses."""
2
3
4def default_desc(exception):
5 """Get the default response description for an exception.
6
7 Args:
8 exception (rest_framework.exceptions.APIException):
9 A subclass of APIException for which the response description
10 should be returned.
11
12 Returns:
13 (int, str):
14 A tuple containing the matching status code and default description
15 for the exception.
16
17 """
18 return exception.status_code, str(exception.default_detail)