Fixed incorrect handling of exceptions in async tasks

This commit is contained in:
Raphael Michel
2016-11-19 20:44:14 +01:00
parent bfe66e97bf
commit 5ef52598c6

View File

@@ -30,7 +30,7 @@ class AsyncAction:
return JsonResponse(data)
else:
if res.ready():
if res.successful():
if res.successful() and not isinstance(res.info, Exception):
return self.success(res.info)
else:
return self.error(res.info)
@@ -89,7 +89,7 @@ class AsyncAction:
return JsonResponse(self._return_ajax_result(res, timeout=0.25))
else:
if res.ready():
if res.successful():
if res.successful() and not isinstance(res.info, Exception):
return self.success(res.info)
else:
return self.error(res.info)