diff options
| author | Carlton Gibson | 2014-04-04 16:36:41 +0200 |
|---|---|---|
| committer | Carlton Gibson | 2014-04-04 16:36:41 +0200 |
| commit | 115fe04842b58226b9fa29069b95af7df62b046a (patch) | |
| tree | da9e2c382982fd4f96b2d0b00bc59b706937b8cf /rest_framework/exceptions.py | |
| parent | 591cf8a48c6e5ce37d205c4b7e418fb7d2c31b0f (diff) | |
| parent | 6322feb32dceb7be67b2117686f0a7570a615294 (diff) | |
| download | django-rest-framework-115fe04842b58226b9fa29069b95af7df62b046a.tar.bz2 | |
Merge pull request #1501 from jacobg/patch-1
add a __str__ implementation to APIException
Diffstat (limited to 'rest_framework/exceptions.py')
| -rw-r--r-- | rest_framework/exceptions.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 0ac5866e..5f774a9f 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -20,6 +20,8 @@ class APIException(Exception): def __init__(self, detail=None): self.detail = detail or self.default_detail + def __str__(self): + return self.detail class ParseError(APIException): status_code = status.HTTP_400_BAD_REQUEST |
