Skip to content

Harden cds get error handling for copy and path-resolution failures #451

Description

@RonaldHensbergen

Summary

cds get currently has a few failure paths where low-level exceptions can surface instead of a consistent GetError message. This can produce less actionable CLI output and inconsistent error handling.

Problem

  • _add_copy_action can raise uncaught path/relative computation errors in edge cases.
  • shutil.copy2(...) can raise uncaught OSError during file copy.
  • Users should consistently receive clean ERROR ... output from cds get.

Proposed change

  • Wrap path-resolution and copy operations in defensive error handling.
  • Re-raise expected failures as GetError with context about source/destination.
  • Preserve current success behavior while improving failure clarity and safety.

Acceptance criteria

  • No uncaught traceback for expected filesystem/path failures in cds get.
  • Errors are surfaced as GetError and reported via current CLI error flow.
  • Existing cds get behavior remains unchanged on successful runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCLI commands and behaviorbugSomething isn't workingpythonPull requests that update python code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions