celery.task.retry exc param should be a throwable.

This causes an issue when it hits the max retry limit, and tries to
throw your exception to let you deal with it - at this point it was
moaning because we pass in a string

if it's not defined, and we're inside an exception block celery uses
that instead.
This commit is contained in:
Leo Hemsted
2017-11-23 13:49:52 +00:00
parent 2ddf05a645
commit b6ac7f074d
3 changed files with 11 additions and 13 deletions

View File

@@ -13,6 +13,6 @@ def process_ses_results(self, response):
errors = process_ses_response(response)
if errors:
current_app.logger.error(errors)
except Exception:
except Exception as exc:
current_app.logger.exception('Error processing SES results')
self.retry(queue=QueueNames.RETRY, exc="SES responses processed with error")
self.retry(queue=QueueNames.RETRY)