Skip to content

Fix backup import/export error handling #184

@jeff-schnitter

Description

@jeff-schnitter

Summary

Two issues with backup command error handling:

  1. cortex backup import exits with return code 0 even when it fails (e.g., with invalid API key)
  2. cortex backup export prints ugly Python stack trace on failure (though it does exit non-zero)

Reproduction

# Test with invalid API key
CORTEX_API_KEY=invalid cortex backup import -d /some/path
echo $?  # Returns 0 (should be non-zero)

CORTEX_API_KEY=invalid cortex backup export -d /some/path
# Prints stack trace (should be clean error message)

Tasks

  • Add test for backup import with invalid API key, verify non-zero exit
  • Fix backup import to exit non-zero on failure
  • Fix backup export to suppress stack trace on failure
  • Add test for backup export error handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions