[fb] Use SkipFile instead of StopUpload in case of exception during file upload
StopUpload() is going into an infinite loop in exhaust().
SkipFile() seems like a good alternative that propates the
error properly to the UI.
@@ -29,7 +29,7 @@ import errno
import logging
import time
-from django.core.files.uploadhandler import FileUploadHandler, StopFutureHandlers, StopUpload, UploadFileException
+from django.core.files.uploadhandler import FileUploadHandler, StopFutureHandlers, StopUpload, UploadFileException, SkipFile
from django.utils.translation import ugettext as _
import hadoop.cluster
@@ -164,7 +164,7 @@ class HDFSfileUploadHandler(FileUploadHandler):
if not self._activated:
if self.request.META.get('PATH_INFO').startswith('/filebrowser') and self.request.META.get('PATH_INFO') != '/filebrowser/upload/archive':
- raise StopUpload()
+ raise SkipFile()
return raw_data
try:
