Try reporting a little more info from taskhandler deserialization error

This commit is contained in:
Griatch 2021-06-18 19:34:39 +02:00
parent 95a2b18d43
commit 41986e1288

View file

@ -340,11 +340,11 @@ class TaskHandler(object):
# an unsaveable callback should immediately abort # an unsaveable callback should immediately abort
try: try:
dbserialize(callback) dbserialize(callback)
except (TypeError, AttributeError, PickleError): except (TypeError, AttributeError, PickleError) as err:
raise ValueError( raise ValueError(
"the specified callback {} cannot be pickled. " "the specified callback {callback} cannot be pickled. "
"It must be a top-level function in a module or an " "It must be a top-level function in a module or an "
"instance method.".format(callback) "instance method ({err}).".format(callback=callback, err=err)
) )
return return