Currently TaskError and TaskTimeout take Task.data() (dict) as constructor argument.
This could be changed to taking the full Task object.
Pros:
everything on these Exceptions is already named task, but it's only data tasks for now (unexpectedly): it would respect the "least surprise principle".
we would have normalized access to the failed task when handling exceptions
it would make it easier to control how everything is displayed (__str__) (avoid duplicates effort, normalize)
Cons:
in some cases (Task never refreshed, can happen when API is down), accessing Task fields lazy loads data from API, this would be unexpected when handling an error (and could create errors during errors (+ the long auto retry))
Currently
TaskError
andTaskTimeout
takeTask.data()
(dict
) as constructor argument. This could be changed to taking the fullTask
object.Pros:
task
, but it's only data tasks for now (unexpectedly): it would respect the "least surprise principle".__str__
) (avoid duplicates effort, normalize)Cons:
Task
fields lazy loads data from API, this would be unexpected when handling an error (and could create errors during errors (+ the long auto retry))