tasks: improve logging on failed tasks

This commit is contained in:
RhodeCode Admin 2023-01-31 09:26:54 +01:00
parent 01c3bcde81
commit 07bf79ea48

View file

@ -276,7 +276,11 @@ class RequestContextTask(Task):
raise Exception(
'Unable to fetch required data from request: {}. \n'
'This task is required to be executed from context of '
'request in a webapp'.format(repr(req)))
'request in a webapp. Task: {}'.format(
repr(req),
self
)
)
if req:
# we hook into kwargs since it is the only way to pass our data to