Skip to content

Add Error Handling #19

@abhibongale

Description

@abhibongale

Add comprehensive error handling throughout StackBox with helpful error messages that guide users to solutions. Handle common failure scenarios gracefully.

Goals

  • Catch and handle common errors
  • Provide actionable error messages
  • Suggest fixes for problems
  • Improve user experience

Common Errors to Handle

Docker not running

try:
    subprocess.run(["docker", "ps"], check=True, capture_output=True)
except:
    click.echo("❌ Docker not running")
    click.echo("   Start with: sudo systemctl start docker")
    sys.exit(1)

Ports already in use

if port_in_use(6385):
    click.echo("❌ Port 6385 already in use")
    click.echo("   Check: lsof -i :6385")
    sys.exit(1)

Insufficient resources

if disk_space_gb() < 20:
    click.echo("⚠️  Low disk space (< 20GB)")
    click.echo("   Clean up: docker system prune")

Acceptance Criteria

  • All subprocess calls have error handling
  • Error messages are helpful
  • Suggests solutions
  • No raw Python tracebacks shown to user
  • Exit codes are appropriate

Testing

Test each error scenario and verify helpful message is shown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions