diff options
| author | Tom Christie | 2012-02-22 13:09:09 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-02-22 13:09:09 +0000 |
| commit | 8e0b9e55ecb0733369918d4562ba38ba505cdfe8 (patch) | |
| tree | fa58394b0dfbc735bca2ae6ca563f31dfc9d39ba | |
| parent | b2b1a0354f64a4f4d5e5d36fa50d2d286e15918e (diff) | |
| download | django-rest-framework-8e0b9e55ecb0733369918d4562ba38ba505cdfe8.tar.bz2 | |
Properly catch MultiPartParserError during .parse()
| -rw-r--r-- | djangorestframework/parsers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index 7481666b..a19582b7 100644 --- a/djangorestframework/parsers.py +++ b/djangorestframework/parsers.py @@ -167,10 +167,10 @@ class MultiPartParser(BaseParser): upload_handlers = self.view.request._get_upload_handlers() try: django_parser = DjangoMultiPartParser(self.view.request.META, stream, upload_handlers) + return django_parser.parse() except MultiPartParserError, exc: raise ErrorResponse(status.HTTP_400_BAD_REQUEST, {'detail': 'multipart parse error - %s' % unicode(exc)}) - return django_parser.parse() class XMLParser(BaseParser): |
