Skip to content

TaskError and TaskTimeout could take Task instead of Task.data() as constructor argument #71

@thomas-riccardi

Description

@thomas-riccardi

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions