Skip to content

Handle secondary errors during cleanup after run failure #84

Description

@ahogappa

What

Handle the case where both run and clean fail, ensuring error information is not lost.

Goal

When a task's run method fails and subsequently the clean method also fails, both errors should be preserved and accessible for debugging. Currently, cleanup errors may shadow or obscure the original run error.

Approach

  • Capture the original run error before executing cleanup
  • If cleanup also fails, combine both errors in a way that preserves the root cause
  • Options include: logging cleanup errors while re-raising run error, creating a composite error type, or storing cleanup errors separately for inspection

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions