aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-02-22 13:09:09 +0000
committerTom Christie2012-02-22 13:09:09 +0000
commit8e0b9e55ecb0733369918d4562ba38ba505cdfe8 (patch)
treefa58394b0dfbc735bca2ae6ca563f31dfc9d39ba
parentb2b1a0354f64a4f4d5e5d36fa50d2d286e15918e (diff)
downloaddjango-rest-framework-8e0b9e55ecb0733369918d4562ba38ba505cdfe8.tar.bz2
Properly catch MultiPartParserError during .parse()
-rw-r--r--djangorestframework/parsers.py2
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):